Home ›
Fix messy Mac-style line endings to have proper Unix text file formatFix messy Mac-style line endings to have proper Unix text file format
Submitted by Benjamin Melançon on January 23, 2009 - 7:51am
In a vi text editor as reached from the command line shell with vi filename.txt
or an excellent GUI such as MacVim, enter:
:%s/\r/\r/g
and your file will be beautiful, even if only parts of it were messed up with ^M non-working line breaks.
Thanks to the comment at this post.
Resolution
Searched words:
vi convert line endings ^M
MacVim corrected carrot em characters mashed together in one line
CR LF new line right encoding carriage return broken
correct M
Comments
Post new comment