Thanks for this:
inputFile = test.csv
searchTerm = 1234
Loop, Read, %inputFile% ; reads all lines one by one
{
thisLine := A_LoopReadLine
thisLineNr := A_Index
StringSplit, fieldArr, thisLine, `, ; get array of the fields
If (fieldArr1 = searchTerm) ; first field
Break ; break out of file reading
}
MsgBox, , Found it!, Found "%searchTerm%" in first field of line %thisLineNr%`n`n%thisLine%
Would this be faster, more memory efficient than :
search := 1234
Loop, Read, numbermatch.csv
{
StringSplit, item, A_LoopReadLine, `,, `r`n
If ( item1 = search )
{
var:=Notify(BLAH BLAH)
Break
}
}
I combine that with another if statement, as below:
How should I write this to be more efficient ?
search := word_array5
Loop, Read, numbermatch.csv
{
StringSplit, item, A_LoopReadLine, `,, `r`n
If ( item1 = search )
{
var:=Notify(BLAH BLAH)
Break
}
}
if (item1 != search)
{
if word_array7 = %topa%
{
var:=Notify(BOO HO)
} else {
var:=Notify(YEH HAA)
}
}
Thanks