Tuesday, September 22, 2009

how to remove ^M in vi

:1,$s/^M//g

^M: Ctrl+V, and press Enter

[2014/05/30 updated]
It seems dos2unix is better than this command.

dos2unix – Removing Hidden Windows Characters from Files
http://www.liquidweb.com/kb/dos2unix-removing-hidden-windows-characters-from-files/

No comments:

Post a Comment

You can leave any question here and I will make a response to you ASAP. :D