Wednesday, June 16, 2010

Convert text files between Unix, Mac, and Windows

screenshot of Flip

Everything in the world is connected. This is especially true with computer stuff. There are servers talking to servers, and desktop machines, smart phones, and all manner of other electronic goodies that talk to one another. The wonder of it all is that for the most part, they each understand what the other is saying. There is one notable exception, of course: the lowly text file.

Even though the text file is arguably the least-complicated kind of file out there, they are not all created equally. Even though these files are just text, no pictures, no formatting, no fancy stuff, there are differences between text files, depending on where a given file was created. Those differences all come with the end-of-line character–the way that your computer knows that one line has ended and the next one begins.

In the Unix world, the end of a line in a text file is indicated by the LineFeed character (0×0A), in the world of the Mac (at least through OS 9) it's the Carriage Return character (0×0D), and in DOS and Windows, it's the combination of the two (0×0D and 0×0A). While some apps are tolerant of these differences, others aren't nearly so well behaved. Create some web server configuration file on your Mac and upload it to your Unix web server, and you'll see what a mess things can be.

The solution? It could be something as simple as Flip, a little utility app that you can download. It's just a console app–no fancy GUI here–that allows you to convert files from one format to another. You can use it on single files, or on a whole bunch of them. A command line argument tells it which flavor you want your resulting files to be.

Flip is available in versions for Linux, Mac, and Windows machines.

Download Flip

Enter your email address:

Delivered by FeedBurner