CartMetrix - Do you know yours?

« Add Banned IP DNS Info to BFD Emails | Home | Mint Pepper DLoads 0.70 Beta »

1/5/2006

Convert Mac Line Endings

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.

Usage: flip [-t|-u|-d|-m] filename[s]
Converts ASCII files between Unix, MS-DOS/Windows, or Macintosh newline formats

Options:
-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:

Popularity: 34%

Trackback:

Related Posts

One Response to “Convert Mac Line Endings”

  1. Chris said:

    Use it like this if you will (Assuming you want to convert all cpp and h line endings to dos):

    cd to project directory
    find . -name ‘*.cpp’ | xargs /tools/flip -d; find . -name ‘*.h’ | xargs /tools/flip -d;

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It