Friday, April 25, 2014

remove ^M from file

Sometimes file automatic get post-fix by ^M in every line, and it can leads to hassle to hard to handle the files, which are related to code and can cause unexpected error in
code.

How to remove ^M from whole file.


Open terminal and locate the file

vim /root/Desktop/test.txt
(press escape)
(press :)
full command is :%s/ctrl+v+m//g

(press CTRL, V, M all together)



:wq

(save and exit)




and then enter. thats it.

No comments:

Post a Comment

web stats