Hi, I am pretty new to AutoIT and also new to scripting/programming - so please take it easy
I am trying to determine if a string is present in a text file. The code is below.. it does not work and I am even more confused now then when I started..
can anyone please help
Many thanks in advance, Steve
#include <File.au3>
$filetosearch = FileOpen("new.txt", 0)
While 1
$line = FileReadLine($filetosearch)
If @error = -1 Then ExitLoop
If StringInStr("$line", "bad") Then
MsgBox(0, "Found", $line)
Else
MsgBox(0, "not found", $line)
FileClose($filetosearch)
EndIf
WEnd
FileClose($filetosearch)