How to convert RTF to Markdown on a UNIX / OSX command line similar to pandoc

How to convert RTF (say from stdin) to Markdown using the command line tool under UNIX / OSX.

I am looking for something like pandoc . However, pandoc alone does not allow RTF as an input format. :-( So, I would be happy either with a similar tool for pandoc , or with a pointer to an external RTF reader for pandoc .

+6
source share
2 answers

On Mac OSX, I can use the pre-installed textutil command to convert RTF-to-HTML, and then convert through pandoc to markdown. So the command line that takes RTF from stdin and writes markdown to stdout looks like this:

 textutil -stdin -convert html -stdout | pandoc --from=html --to=markdown 
+10
source

Using Ted and pandoc together, you should be able to do this:

 Ted --saveTo text.rtf text.html pandoc --from=html --to=markdown --out=text.md < text.html 
+1
source

Source: https://habr.com/ru/post/987892/


All Articles