Batch Convert Text Files To Different Formats In Terminal

Batch Convert Text Files To Different Formats In Terminal

Converting texts between formats is a bit of a pain to do on a file-by-file basis, but thankfully MacIssues shows how to convert text files in bulk using a simple terminal command.

The tool you’ll use here is textutil, which can convert any single text file into another. Converting one file to another is pretty straight. For example, here’s how you’d convert a file to DOCX:

textutil -convert docx ~/Desktop/mypage.webarchive

You can do this in bulk by simply pointing to a specific folder. For example, if you wanted to convert a group of text files in a folder on your desktop from TXT to DOCX you’d type this into Terminal:

textutil -convert docx ~/Desktop/TextDocuments/*.txt

Of course, that’s just one of the more basic things textutil can do. You can also use it to bulk change fonts, font sizes and more.

Convert various text file formats in the OS X Terminal with textutil [MacIssues]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments