2.17.2006

Command to remove all CRLFs from a file

Use the following command to remove CRLF (all) carriage returns and line feeds from a text file, effectively joining all lines into one single line.

Using the tr command in cygwin:
tr -d '\r\n' < sql.txt > sqlnew.txt

If you want to use the tr command outside of the Cygwin environment, the following files must be copied from \cygwin\bin to the directory you want to store them in:
tr.exe
cygwin1.dll
cygintl-3.dll
cygiconv-2.dll

No comments: