Monday, June 14, 2010

Fixing ^M characters in VI

The new line in UNIX-like OS is represented differently than in Windows OS. When a Windows file is viewed in the VI editor, you can see ^M where the line ends. You can remove the ^M character by using the following VI regular expression command:

:%s/^V^M//g

The ^-sign means holding the CTRL-key while pressing the next character.

No comments:

Post a Comment