Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
Const ForReading = 1
CurrentLineNum=0
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTextFile = oFSO.OpenTextFile ("TextFileforReading.txt", ForReading)
Do Until oTextFile.AtEndOfStream
CurrentLineNum=CurrentLineNum+1
sLine = oTextFile.ReadLine
If instr(sline,"LookForMe")
WScript.Echo CurrentLineNum,sLine
Next
End If
Loop
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
http://blogs.technet.com/b/heyscriptingguy/archive/2007/03/29/how-can-i-search-a-text-file-for-strings-meeting-a-specified-pattern.aspx