Getting rid of ^M (Carriage Returns) with Vim

Open file using vim

In command mode, do a global substitution :%s/^M//g

using Ctrl-V Ctrl-M to create the ^M.

Getting rid of ^M using sed

sed -e 's/^M//g' file-name > result-file

 

 

Jeff Borders

revised 07/12/04