Hi All -
I have some data that I export from Access to a pipe-delimited text
file. Unfortunately, the text file always has a carriage return symbol
at the end. I need to export this file frequently and send to a system
that cannot accept this character at the end of the file. I am looking
for a way, perhaps with VB code, to automate this process.
I found this code on another Google Group, but I can't get it to work.
Any advice appreciated. :O)
Here is that code:
Function RemoveCarriageReturn_UMG()
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewFile = fso.CreateTextFile("C:\hello.txt")
Set file = fso.OpenTextFile("C:\return.txt")
Do While Not file.AtEndOfStream
CLine = file.ReadLine
CLine = Replace(CLine, vbCrLf, "")
NewFile.Write CLine
Loop
file.Close
NewFile.Close
Set NewFile = Nothing
Set file = Nothing
Set fso = Nothing
End Function