Easy Text File Conversion on the Mac

Like a lot of other web developers, clients provide me content for their sites/applications in all sorts of formats, and it can get a little crazy. But it turns out that a little terminal utility on the Mac can help the stress of text file conversion.

The utility is called textutil and you can access it by going into your Applications > Utilities > Terminal, running Terminal, and then typing textutil. If you type the command without any arguments you’ll see a fairly strong list of options. Textutil supports conversion of txt, rtf, rtfd, html, doc, docx, odt, wordml, and webarchive formats.

Running textutil isn’t as hard as it looks. For example, I have a lot of clients that send me material in .docx or .odt format. I like to convert them over to .rtf files for quicker review (so Word or OpenOffice doesn’t have to load up). I make sure I’m in the same directory as the file I’m working with of course, and I execute:

textutil -convert rtf -output introduction.rtf introduction.docx

Once that’s done, you’ll notice an .rtf file is now in the same directory containing the original material.

Now the power of textutil doesn’t end there. Sometimes I want to convert a bunch of files and combine them into a single file. To do that I do something like:

textutil -cat rtf -output combined_project.rtf *.docx

Doing this takes all the .docx files in the current directory and combines them into a single .rtf file called combined_project.

If you have to deal with client provided text a lot, take a serious look at textutil – it has some great features hidden within it’s depths (like font resizing).

Advertisement

Fedora 7 on Fusion

Tonight I decided I was going to install the new distro of the Fedora Project (7). I spent the even downloading the entire 2Gb distribution. After the initial excitement I felt from it’s download completion I started up Parallels, setup the virtual machine – press start… Fedora booted from the CD, started the installation, I selected my language… and then… can’t find media driver? What the hell? How are you reading the data right now? After some web searching I found this to be a common issue in Parallels. My option? Download the distro from repository over HTTP or FTP! Yeah screw that! I just spent the night downloading it – I’m not doing it again.

So what to do…?

Remembering what I heard about VMware Fusion, I downloaded the beta. Installed the product. Set up the virtual machine. And off it goes. I didn’t even have to select my language. Fusion seems far more friendly to Linux distros in addition to Windows. So far the installation of Fedora is running completely smooth I’m about 30% done of the package installation and I’m looking forward to my first run at Fedora.

Reading today of the announcement of Parallels 3.0 – I am curious to learn what there “Linux tools” add-on is in the product. I guess time will tell.