Convert end-of-line characters (revisited)

Oct 21, '03 10:38:00AM

Contributed by: Paul Burney

You can do a command-line conversion between Mac, PC, and Unix line endings using any one of many perl / sed / awk commands, or use the freeware command-line program flip. The nice thing about flip is that it's easy to remember and you don't have to make aliases, etc.

Usage is simple, just use one of the flags: -m, -d, or -u, for traditional Mac, DOS/Windows, or Unix line endings. A -t option will just tell you the type of a file. For example, flip -d *.txt will convert all files ending in .txt to DOS end-of-line characters.

[robg adds: This older hint explains (in the hint and the comments) how to use text editors and/or the command line to convert between Mac and Unix line breaks, but I thought it might be time for a new hint with another solution...]

Comments (11)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031018164326986