Hello, I need to search a text file (which is actually a log file) for a word, ("command successful"), how do I do it? do You know? I thought to open the text file and do a loop...but how do I find the word there??
thanks a lot!
Eli
Printable View
Hello, I need to search a text file (which is actually a log file) for a word, ("command successful"), how do I do it? do You know? I thought to open the text file and do a loop...but how do I find the word there??
thanks a lot!
Eli
dim nFile as integer, sLine as string
nFile = FreeFile
open "C:\MyDirectory\MyFile.log"
while not eof(nFile)
line input #nFile, sLine
if inStr(sLine, "command successful") > 0 then
msgbox "Word Found!"
goto Finish
end if
wend
msgbox "Word Not Found!"
Finish:
-K