Remove ^M from your text files

Page content

#Remove ^M from a file

Easiest way is to use sed to remove the ^M characters. Do this: sed -e "s/^M//" filename > newfilename That’s not a normal ^M (carat capital M). To enter ^M type CTRL-V then CTRL-M.

In vi(m) it’s: :%s/^M//g entering the ^M the same as above.

Who cares how you do it in emacs. :P