Can anyone recommend software (preferably freeware) for batch converting rtf files to txt files on Unix?
4 Answers
There are many different ones, here are the ones I've tested successfully (all open source and free):
- unrtf
- wv
- unoconv
-
1
-
-
Tried these, but also wanted link information, without using full latex or PDF, so I use this too:
grep -ioP 'HYPERLINK "([^)]+)"' (xout) | cut -d' ' -f2 | tr -d '"'
– PysisOct 11, 2022 at 15:50
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
-
2
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.
-
1Ubuntu is right. The man page says: --text selects plain ASCII text output.– ThemrocDec 9, 2016 at 23:54
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.