remove ^M

by ada last modified Jun 12, 2019 12:21 PM

Got a doc with MS-formattings, bloody ^M-linebreaks hanging around everywhere?

Enter this, when viewing a file with <href="http://www.vim.org/" alt="VIM editor homepage">VIM, and they shall disappear:

:e ++ff=dos

Found on: http://vim.wikia.com/wiki/File_format

 

To do this recursively for several files at once, throw this into your shell and make sure to enter the ^M with the key-combination Ctrl+V+M (hold all of them pressed one after another):

find . -name "*.html" -exec sed -i "s/^M//g" {} \;