'Variables for the file and stream
Dim file, newFile, stream, strNew
'set the file object
Set file = CreateObject("Scripting.FileSystemObject")
'set the stream and newFile as instances of the file object
Set stream = file.OpenTextFile(PW_GetJobFilename)
Set newFile = file.CreateTextFile("c:\me03c4\filter.txt")
'do loop to filter the last half of the file
Do While strNew <> "CMP/DIV/LOC- 1 1 1 SALESREP-300 GODFATHERS D=SALES DOWN FROM PREVIOUS YEAR PERIOD"
If strNew = "CMP/DIV/LOC- 1 1 1 SALESREP-180 COMPASS MNG HEALTH.LTC 13 D=SALES DOWN FROM PREVIOUS YEAR PERIOD" then
Do While strNew <> "CMP/DIV/LOC- 1 1 1 SALESREP-182 MORRISON'S MANAGE ACUTE13 D=SALES DOWN FROM PREVIOUS YEAR PERIOD"
strNew = stream.ReadLine
newFile.WriteLine strNew
Loop
Elseif strNew = "CMP/DIV/LOC- 1 1 1 SALESREP-200 MARITA DELOBELLE D=SALES DOWN FROM PREVIOUS YEAR PERIOD" then
Do While strNew <> "CMP/DIV/LOC- 1 1 1 SALESREP- SALESREP-300 GODFATHERS D=SALES DOWN FROM PREVIOUS YEAR PERIOD"
strNew = stream.ReadLine
newFile.WriteLine strNew
Loop
Else
stream.SkipLine
strNew = stream.ReadLine
End if
Loop
'closes the stream
stream.Close