Examine each line in a file and output it to another file if a specific string is contained within the line of text.
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFind = "keep me"
Set objInFile = objFSO.OpenTextFile("C:input.txt", 1)
Set objOutFile = objFSO.OpenTextFile("C:output.txt", 8, True)
Do Until objInFile.AtEndOfStream
strLine = objInFile.Readline
intPos = inStr(strLine, strFind)
'Remove NOT below for filter: If does not contain...
If NOT intPos = 0 Then
objOutFile.WriteLine strLine
End If
Loop