Remove M characters with vim

Written by
Date: 2014-11-29 16:55:20 00:00


How to get rid of ^M characters

**Q. How can I remove ^M characters from text files?

A. ^M are nothing more than carriage return, so it is easy to use the search and replace function of vim to remove them.

Enter vim and open the file. Then enter this after hitting ":" (Without the quotes)

%s/\r//g

That will do the job.