Tuesday, February 14, 2012

Remove %M in vi

After I concat a file using a IO redirect (>>) in linux, it causes %M to appear in every lines in a file. I don't know if I did something wrong.
But, to remove %M from file in vi / vim use this command in vi

:s/[CTRL + V][CTRL + M]//g

Note that [CTRL +V] is to press CTRL + V on the keyboard as well as [CTRL + M]
That's the replace pattern (:s/[pattern]/[replace]/) in vim and /g is to replace all occurence in a file.

1 comment:

Anonymous said...

My brother suggested I may like this website.
He was once totally right. This submit truly made my day. You cann't imagine simply how
so much time I had spent for this info! Thanks!