Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am making a text search engine. I need to first convert binary documents to text. I want to go with cross-platform (we develop both on windows and linux) command line (so that I can get the output via python subprocess). What are the choices for this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

There's pdftotext for PDFs and antiword for DOC (not sure about DOCX). Both free software for command line. Used both on Linux before, worked fairly well.

Sphider, a free search engine, uses pdftotext and catdoc. catdoc I've used as well, worked fine as well.

For DOC files there's also wv and abiword (abiword is a GUI but also has a command line interface). Haven't been able to test these out, though.

One tip for DOCX:

http://www.livedocx.com/

I have used this to convert DOC to PDF before, was quite good. Perhaps it supports TXT as well, or you could use pdftotext. LiveDocX also can be accessed via a SOAP web service

PS: there's also pdftohtml, pdftk command-line tools and then the suite/s LibreOffice, OpenOffice which can take DOCX and natively convert/save everything to text. Didn't try LibreOffice and OpenOffice from command-line, though...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.