Removing ^M From File in Emacs

Posted in: Programming- Dec 06, 2009 1 Comment

If you edit a text file on Windows and you then use it in emacs under a Linux environment you will see the ^M character at the end of each lin.

Do the following to remove it in emacs.

; goto top of buffer
M-x replace-string C-q C-m RET

The control-q will allow you to type control characters into the
input buffer.

Additionally, you could use the dos2unix command.

One Response to “Removing ^M From File in Emacs”

  1. jaibeee says:

    [New Post] Removing ^M From Emacs – via @twitoaster http://www.jamalahbryan.com/2009/12/remo...

Leave a Reply

You must be logged in to post a comment.