textutil: OS X command-line tool of the week

$ textutil -convert rtf 'Business Plan.doc'
$ ls
Business Plan.doc  Business Plan.rtf

omg d00d! Command-line conversion between proprietary and open-source formats!

$ textutil -convert doc 'Live Free Or Die.odt'
$ ls
Live Free Or Die.doc  Live Free Or Die.odt
$ file Live\ Free\ Or\ Die.doc
Live Free Or Die.doc: Microsoft Office Document

man textutil for more details. Other supported formats (besides the demonstrated RTF, MS Word, and OpenOffice) include plain text and HTML. It can also display document metadata (including of Word documents) and convert documents from one text encoding (UTF-8, ASCII, KOI-8, ...) to another. Whee!


About this entry