Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Remove ^M characters using vi (See related posts)

To remove all "^M" characters from a file, open it in vi and use this command:
:%s/^M//g

The "^M" in the above line has to be typed in by pressing CTRL+v and then CTRL+M.

Comments on this post

ubernostrum posts on Oct 28, 2005 at 02:32
The built-in Unix command 'dos2unix' (type it on a command line, not in vi) can also be used to do this.

You need to create an account or log in to post comments to this site.


Related Posts