I am working with some code that - for some reason - it skips that last line in the text file...?? I just can't figure it out....
Below is what I am working with...
Can anybody help me out with some suggestions or examples..??
Thanks in advance..!!
jcw5107
Dim intFileIn As Integer, intFileOut As Integer
Dim strReadBuffer As String, strWriteBuffer
intFileIn = FreeFile
Open "D:\UPSDATA\SchedWorkWAN1.txt" For Input As #intFileIn
intFileOut = FreeFile
Open "D:\UPSDATA\SchedWorkWAN2.txt" For Output As #intFileOut
Line Input #intFileIn, strReadBuffer
Do While Not EOF(intFileIn)
strWriteBuffer = strWriteBuffer & " " & strReadBuffer
Line Input #intFileIn, strReadBuffer
If Left(strReadBuffer, 2) = "E " _
Or Left(strReadBuffer, 2) = "S " _
Or Left(strReadBuffer, 2) = "P " Then
Print #intFileOut, strWriteBuffer
strWriteBuffer = ""
End If
Loop
Close #intFileIn
Close #intFileOut
Below is what I am working with...
Can anybody help me out with some suggestions or examples..??
Thanks in advance..!!
jcw5107
Dim intFileIn As Integer, intFileOut As Integer
Dim strReadBuffer As String, strWriteBuffer
intFileIn = FreeFile
Open "D:\UPSDATA\SchedWorkWAN1.txt" For Input As #intFileIn
intFileOut = FreeFile
Open "D:\UPSDATA\SchedWorkWAN2.txt" For Output As #intFileOut
Line Input #intFileIn, strReadBuffer
Do While Not EOF(intFileIn)
strWriteBuffer = strWriteBuffer & " " & strReadBuffer
Line Input #intFileIn, strReadBuffer
If Left(strReadBuffer, 2) = "E " _
Or Left(strReadBuffer, 2) = "S " _
Or Left(strReadBuffer, 2) = "P " Then
Print #intFileOut, strWriteBuffer
strWriteBuffer = ""
End If
Loop
Close #intFileIn
Close #intFileOut