cosfreelance
MIS
Please can anybody assist, I am trying to skip lines in a text file and cant seem to figure why this is not working. Thanks in advance
tmp_file = "C:\test.dat"
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(tmp_file, 1)
i = 0
tmpstr = ""
break = False
Do While (objTS.AtEndOfStream <> False)
do While break <> True
i = i + 1
If i = 469 Then
break = True
End If
objTS.SkipLine
Loop
tmp = objTS.readline
tmpstr = tmpstr & tmp & VbCrLf
Loop
objTS.Close
WScript.Echo (tmpstr)
Set objFSO = Nothing
Set objTS = Nothing
tmp_file = "C:\test.dat"
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(tmp_file, 1)
i = 0
tmpstr = ""
break = False
Do While (objTS.AtEndOfStream <> False)
do While break <> True
i = i + 1
If i = 469 Then
break = True
End If
objTS.SkipLine
Loop
tmp = objTS.readline
tmpstr = tmpstr & tmp & VbCrLf
Loop
objTS.Close
WScript.Echo (tmpstr)
Set objFSO = Nothing
Set objTS = Nothing