|
-
June 19th, 2001, 07:53 AM
#1
How to search for a word in a text file?
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
-
June 19th, 2001, 08:09 AM
#2
Re: How to search for a word in a text file?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|