# ASCII-fying RTF from the command line

**URL:** https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975
**Category:** Factual Questions
**Created:** [January 25, 2011, 10:12pm UTC](https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975 "2011-01-25T22:12:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [January 25, 2011, 10:12pm UTC](https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975/1 "2011-01-25T22:12:40Z")

</div>

Suppose I have an RTF file, with things like colors and superscripts/subscripts in it, and I want to be able to strip out all of the extra formatting and turn it into just a plain text file. I could do this, for example, by selecting everything in the RTF file, copying it to the clipboard, and pasting it into a text editor. But suppose I want to be able to do this in an automated way, from the command line. Is there any simple, standard tool that will do this?

To be a little more clear on my requirements, I do _not_ want to leave any trace of the formatting: Text that was formerly superscripted should not be indicated by a ^, or anything like that. And it is essential that it _does_ preserve all whitespace.

If it matters, I’m on Mac OSX, 10.4 or 10.6, and the RTF files would be of the sort generated by TextEdit.

---

<div class="post-metadata">

### Author: ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)
#### Post date: [January 25, 2011, 10:40pm UTC](https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975/2 "2011-01-25T22:40:02Z")

</div>

In Terminal, type ‘man textutil’

> [@](#):
>
> -convert fmt Convert the specified files to the indicated format and  
> write each one back to the file system.  
> …  
> fmt is one of: txt, html, rtf, rtfd, doc, docx, wordml, odt, or webarchive

---

<div class="post-metadata">

### Author: ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)
#### Post date: [January 25, 2011, 10:50pm UTC](https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975/3 "2011-01-25T22:50:07Z")

</div>

[UnRTF does everything you want and more.](http://www.gnu.org/software/unrtf/) Look to your distro’s package management system to install it.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [January 25, 2011, 11:20pm UTC](https://boards.straightdope.com/t/ascii-fying-rtf-from-the-command-line/568975/4 "2011-01-25T23:20:09Z")

</div>

Thanks **Squink** , it looks like that does exactly what I want.
