Tuesday, January 9, 2007

delete ^M in vi

Need to delete ^M again in some schema files.
Why it always happen, why can't those softwares handle it internally.

Hope the M$ and Novel deal will help to eliminate those small and big difference between Unix and Windows world.

Anyway, here is the step to delete ^M suing VI.
%S/^V^M//g
The ^V is CONTROL-V and ^M is CONTROL-M

'ga' command in vi can show the hex value of current character.
If you move cursor to ^M, and give 'ga' command. it will show:
<^M> 13, Hex 0d, Octal 015

This is actual value of ^M we dislike

No comments: