what if there are more than one listed the most say apple and cherry both have 3 duplicates
load file into variable
data file consists of:
orange
cherry
pear
apple
apple
cherry
peach
apple
Code: Select all
file := "data.txt"
;load data into variable
FileRead, LoadedText, %file%
;load array
MatchesArray := []
; Split on new line
myArray := StrSplit(LoadedText, "`n")
;get lines that have apple and store in array
outerConter = 0
innerCounter = 1
;msgbox % MatchesArray[0]
Loop, % MatchesArray.MaxIndex()
{
outerConter++
msgbox % MatchesArray[outerConter]
Loop, % MatchesArray.MaxIndex()
{
if (innerCounter = outerCounter) {
}
innerCounter++
outer := myArray[outerConter]
inner := myArray[innerCounter]
msgbox inner: %inner% outer: %outer%
;msgbox % MatchesArray[outerContrer+1]
}
}