Do you want to remove the carriage return, the line feed or both?
If you remove a CR, LF or CRLF the following two lines:
Line1
Line2
may end up as:
Line1Line2
So you want to be sure that's what you want.
If you really want to remove the carriage returns, you could use Excel, Word or even Access, for that matter, but a VB script would probably be the quickest to write and use. The following opens a file named Myfile.txt and removes all the carriage returns, then saves the file as Myfile2.txt.
It replaces the CR with a space, but you can use whatever you want for replacement character(s).
If you really want to remove the carriage return and not replace it, then change:
thisTxt = Replace(thisTxt, vbCR, " "
with
thisTxt = Replace(thisTxt, vbCR, ""
I commented out two lines, in case what your really after if the LineFeed, or the CarriageReturn/LineFeed.
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject"
Set ReadFile = fs
penTextFile("c:\Myfile.txt", ForReading)
thisTxt = ReadFile.ReadAll
Readfile.close
thisTxt = Replace(thisTxt, vbCR, " "
'thisTxt = Replace(thisTxt, vbLF, " "
'thisTxt = Replace(thisTxt, vbCRLF, " "
set WriteFile = fso.CreateTextFile("c:\Myfile2.txt", ForWriting, True)
WriteFile.Write(thisTxt)
WriteFile.Close
Msgbox "Done removing the carriage returns"
If you haven't used VB script files, just paste the above code into Notepad and save it with a .vbs extention.
Example:
CRreplacement.vbs
Then open up Windows Explorer and double-click on
CRreplacement.vbs (or whatever you named it).
When the script is finished, a message will pop-up, so that you know something happened.
After you run the script don't forget to refresh the Windows explorer filelist (shortcut is F5), otherwise depending on which flavor of windows you're using you may not see the new file that got created.