With a little side of applesauce...

Wednesday, May 14, 2008

emacs - dos2unix

Posting, since I always forget this:
<snip>
Let’s fix the nastier problem first. When you find a file corrupted with half LFs and half CRLFs, strip out the ^M (CR) characters with a quick search and replace. Run M-% (query-replace) and substitute C-q C-m with nothing. C-q runs quoted-insert and is useful for inserting control characters (e.g. ^M, entered as C-m). Afterwards hit the exclamation point (!) to tell query-replace to replace all matches with no questions.
</snip>


From this great blog entry:
http://www.emacsblog.org/2007/04/30/quick-tip-dos2unix-et-al/

No comments: