Saturday 4 October 2014

UNIX: Remove CTRL-M

Remove CTRL-M characters from a file in UNIX

Type this command:
sed -e "s/^M//" filename > newfilename
To enter ^M, type CTRL-V, then CTRL-M.
That is, hold down the CTRL key then press V and M in succession.

Easiest option Remove CTRL-M characters from a file in UNIX

cat test1.txt | col -b > newfilename.txt

1 comment:

  1. this is the most head part to remove these type of characters great work and nice to share with everyone Visit:www.datastage.in

    ReplyDelete