It does not matter which line it deletes that have a matching OutputArray5
In this example it does not matter which of these 2 it removes, because OutputArray5 (MIN100) is an exact match.
Vases*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA
or
Flowers*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA
My code is incorrect because it finds MIN100 in lines that contain MIN100-LG,MIN100-SM,MIN100-MD and MIN100-SIL and therefore treats them as duplicates.
Code: Select all
var =
(
Decor*12" Large Glass Vial*$2.25*In Stock*MIN100-LG*ShelfA
Bowls*12" Pedestal Bowl*$75.00*Out of Stock*CQU025*ShelfA
Decor*6" Small Glass Vial*$1.75*In Stock*MIN100-SM*ShelfA
Flowers*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA
Glass*8" Medium Glass Vial*$2.00*In Stock*MIN100-MD*ShelfA
Vases*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA
Vases*Japanese Flower Blossoms Vase*$150.00*In Stock*DRU255*ShelfA
Vases*Lavoisier Set of 10 Hinged Flower Vases*$82.50*In Stock*MIN100-SIL*ShelfA
Decor*S/2 Amazonite Boxes*$55.00*In Stock*HCM008-AMS2*ShelfA
)
Loop, Parse, Var, `n
{
StringReplace, outputvar, A_LoopField,`r`n,,All
StringSplit,OutputArray,Outputvar,*
IfNotInString, NoDuplicates, %OutputArray5%
{
if NoDuplicates =
NoDuplicates = %a_loopfield%
else
NoDuplicates := (NoDuplicates a_loopfield "`n" )
}
}
msgbox,,Ahk %a_linenumber%, % NoDuplicates
;NoDuplicates is missing both lines that contain MIN100 as OutputArray5
;Flowers*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA
;Vases*S/10 Hinged Flower Vase*$82.50*In Stock*MIN100*ShelfA