Hi,
^M is a line feed character. UNIX/Linux systems use only the carriage return (CR; ASCII 15) character at the end of a line, Mac's use line feed (LF; ASCII 32), and windows uses carriage return and line feed (CRLF)
Inside vim do this:
In the above,
^M is an excape sequence and must be created using Ctrl+V then Ctrl+M. If you type carot-M it will not work.
Or on the command line using
tr:
Code:
tr -d '\15\32' < winfile.txt > unixfile
Or using
awk:
Code:
awk '{ print $0 "\r"}' unixfile > winfile.txt
Or using
sed Code:
sed 's/\r$//' winfile > unixfile
Or using
perl Code:
perl -p -e 's/\r$//' < winfile.txt > unixfile