Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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:

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

One supplement for pdf to text, i know another open source: PDFLib tool. this library can convert whole pdf page to text with the page layout. and it supports multiple languages(all the ascii language), such as english, french, latin, besides, the CJK language is also supported, so it's very useful for your text search engine. and i find a online pdf to text tool using PDFLib, so you can make a performance of the PDFlib.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .