News for hackers. Stuff that matters.
Re:Pandoc by epynonymous on Tuesday August 28, 2018 @01:54AM (#17856813)
i have been using catdoc and pdftotext to convert doc and pdf files, respectively. nice to see that there's an alternative that also includes a library, will be checking this out.

a couple questions i have, seems firstly that old school .doc files are not supported, docx yes. unfortunately i still get a lot of docs in .doc format which seems to be microsoft's proprietary format (docx seems to be more open).

my second question is whether or not there's a filter for golang, most of my development is in golang, so i either need to call your cli as a forked process or best to have a native library. i have never worked with haskell so not sure if i can import a haskell library from golang directly. i imagine there'd need to be a golang wrapper around the cli.

Re:Pandoc by duckerude on Tuesday August 28, 2018 @07:01AM (#17857849)
You could use Libreoffice's command line interface to convert from .doc to a more manageable format.

  lowriter --convert-to odt some-document.doc
odt is not the only supported target, but doc --libreoffice--> odt --pandoc--> plain seems to give better results than e.g. doc --libreoffice--> txt or doc --libreoffice--> docx --pandoc--> plain.
Re:Pandoc by epynonymous on Tuesday August 28, 2018 @12:43PM (#17860339)
if that's the case, i'll stick with catdoc. my use case is to create a full text search index of the content, trading libre office cli for catdoc, i'd rather just stick with catdoc, but thanks.
Re:Pandoc by mb2100 on Tuesday August 28, 2018 @06:16AM (#17857699)
1. yes, only docx is supported. 2. for Go pandoc filters, this seems to work: https://github.com/oltolm/go-pandocfilters
Re:Pandoc by epynonymous on Tuesday August 28, 2018 @11:39AM (#17859646)
thanks, will check this out