Convert Mac to Unix line endings in VI
If you open a text file in VI and see one big line with lots of '^M' where the line endings are supposed to be, use this command to fix it.
(Enter the the ^M by hitting ctrl-v and then the return key.)
(Enter the the ^M by hitting ctrl-v and then the return key.)
:1,$s/^M/\r/g