Sunday, February 24, 2013

How to remove ^M from file using Vi Editor?

We can Replace ^M from file in Vi Editor by using any search and replace command i.e.  :%s/^M//g  or :1,$s/^M//g

Imp to note :

Here ^ is not the simple keyboard key, you can get the character by pressing Ctrl + V.so to get ^M you have to press "Ctrl + V then immediately M.