Vim: Replacing ^M with a new line
SEOPublished March 12, 2010 at 1:11 pm 2 CommentsI recently uploaded some new software for a domain I utilize – and of course the dreaded newline replacements (^M) are all over the place. To fix this – I type one simple line:
For Mac Users in VIM or VI:
%s/\r//g
For windows users in VIM or VI:
%s/[cntrl+m]//g
This will replace them throughout the file. Happy Coding!

you can use the dos2unix command to get rid of the ^M.
I should have mentioned the syntax; you can do:
dos2unix filename filename
this makes the conversion and puts the changes back into the same file.