News, info, and opinion by Mac users, for Mac users.

December 1, 2006

geekery

Juggle document formats with ‘textutil’

Posted Dec. 1, ’06, 1:30 PM PT by Collin Allen
Category | Geekery

TerminalFrom the how-did-I-miss-this department comes textutil, a command-line tool for juggling various document formats, including HTML, Word’s .doc, RTF, and pure text. This amazing little utility is built right into Tiger, so there’s nothing to download or install. Converting files with textutil is quite simple, requiring only beginner level Terminal skills.

For example, to convert a file from one format to another, open the Terminal, ‘cd’ to the folder where the files are located, and do:

textutil -convert destination_format current_filename

Textutil will then convert the contents of current_filename to for format specified by destination_format. As noted in the (2005!) Macworld article, the new file will retain the same name, but the extension will be different from the original — just as requested. For as long as this information has been available, I’m surprised this one passed me by, so I thought it was surely worth a second glance for those of us who handle all kinds of document file formats.


2 Comments

Joel said:

but couldn't you save all the trouble of using the terminal and simply change the file extention? What's the big deal?

Collin Allen said:

In short, no. Changing the filename extension won't change the contents of the file, which is the purpose of textutil. It actually converts the contents of the file to a different format.

Leave a comment

 




Visit other IDG sites: