matthewspatrick had written this code for me to clean up some CRLF's in an import file we have which works very well. Found that we also just need to delete the last CRLF from our file as that is still causing our DTS import to fail as it tries to import the next row which is blank.
Looking for a solution to add to this to just strip the last CRLF from our TXT file import.
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
Set tsIn = Nothing
Set tsOut = Nothing
Set fso = Nothing