Thursday, March 13, 2008

Remove ^M character

When you edit text file created in Windows system,
you sometimes encounter '^M' character at the end of each line
and found you can't remove '^M' because you can't type '^M' character.

The reason why those files contain ^M character is that the new line
character in Windows system '\r\n' while it's '\n' in unix system.

^M can be removed in VIM with below command
( ^M could be typed by cntl+v+enter )


:%s/^M//g

1 comment:

  1. Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the TV de LCD, I hope you enjoy. The address is http://tv-lcd.blogspot.com. A hug.

    ReplyDelete