Dim fso, tsIn, tsOut, TheLine, arr
Set fso = CreateObject("Scripting.FileSystemObject")
Set tsIn = fso.OpenTextFile("c:\EE-Sample.txt")
Set tsOut = fso.CreateTextFile("c:\Corrected.txt", True)
Do Until tsIn.AtEndOfStream
TheLine = tsIn.ReadLine
arr = Split(TheLine, "^")
If TheLine <> "" Then
If UBound(arr) <> 15 Then
TheLine = TheLine & " " & tsIn.ReadLine
End if
If Not tsIn.AtEndOfStream Then
tsOut.WriteLine TheLine
Else
tsOut.Write TheLine
End If
End If
Loop
tsIn.Close
tsOut.Close
Set tsIn = Nothing
Set tsOut = Nothing
Set fso = Nothing
|