Rtf to txt on Unix

10

3

Can anyone recommend software (preferably freeware) for batch converting rtf files to txt files on Unix?

Fred

Posted 2011-02-08T15:04:43.033

Reputation: 109

Question was closed 2013-01-29T01:03:55.550

1What format do you want the txt files to be? Stripped of all formatting, or somewhat richer, e.g. Markdown, like this site supports? – Daniel Beck – 2011-02-08T17:19:37.003

Answers

4

You didn't mention what flavour of UNIX but I think there's a textutil on many.

http://www.unix.com/man-page/All/1/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

mockman

Posted 2011-02-08T15:04:43.033

Reputation: 206

2That's only available on OS X. Check the bottom of the man page. – Ross Light – 2012-12-03T21:43:27.997

4

There are many different ones, here are the ones I've tested successfully (all open source and free):

  • unrtf
  • wv
  • unoconv

Thor

Posted 2011-02-08T15:04:43.033

Reputation: 5 178

1antiword doesn't work with rtf documents, as far as i can tell. – dino – 2015-06-14T18:05:23.007

@dino: You are right, my mistake. – Thor – 2015-06-15T00:03:29.850

3

There is "unrtf", but while the Ubuntu package data claims that it can create text output, the GNU unrtf homepage does not mention that format. But perhaps you can try that.

jstarek

Posted 2011-02-08T15:04:43.033

Reputation: 928

1Ubuntu is right. The man page says: --text selects plain ASCII text output. – Themroc – 2016-12-09T23:54:35.380

2

A quick glance at an RTF file suggests that RTF markup is anything between {braces} and anything between a backslash and a space \markup. So maybe strings and a short sed/awk/perl script to delete markup would get you close to plain text.

RedGrittyBrick

Posted 2011-02-08T15:04:43.033

Reputation: 70 632