I wasted an hour last week messing with a CSV file I was massaging data in for import into a large SQL database only to find out the reason the import kept dying was because of the Mac line endings. There are many shell script, Perl scripts and shell one liners to convert line endings but I found a program called flip available for OSX, WinXP and Linux that can convert between all three.
Converts ASCII files between Unix, MS-DOS/Windows, or Macintosh newline formats
-u = convert file(s) to Unix newline format (newline)
-d = convert file(s) to MS-DOS/Windows newline format (linefeed + newline)
-m = convert file(s) to Macintosh newline format (linefeed)
-t = display current file type, no file modifications
They are linked here locally as well:
More Related Posts