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

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


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

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


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

Ted --saveTo text.rtf text.htmlpandoc --from=html --to=markdown --out=text.md < text.html