^M characters with vim
you can put this character with so for replace with 'abc' you can use
:%s/^M/abc/g
this is a good sample for work on all text files
vim *.txt
qq
:%s/^M$//g
:%s/^M/ /g
:wnext
q
@q
999@q
qq record commands and q stop recording and @q run it.
also this is a good alternative but sometimes not work
:set ff=unix //to unix file
:set ff=dos //to windows file
http://www.vim.org/tips/tip.php?tip_id=26
:%s/^M/abc/g
this is a good sample for work on all text files
vim *.txt
:%s/^M$//g
:%s/^M/ /g
:wnext
q
@q
999@q
qq record commands and q stop recording and @q run it.
also this is a good alternative but sometimes not work
:set ff=unix //to unix file
:set ff=dos //to windows file
http://www.vim.org/tips/tip.php?tip_id=26
Labels: Linux, Programming

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home