Is there a command line tool to convert documents to plain text files?

Is there a console app (ie command line) to convert standard document types to .txt file? Also, can .docx be converted?

Would it be necessary for users to have LbreOffice installed?

In GNU/Linux there is command line program odt2txt which converts odt (OpenDocument Text), ods (OpenDocument Spreadsheet), odp (OpenDocument Presentation) and sxw (OpenOffice.org XML) to txt.

To use it, you don’t need to have LibreOffice installed.

Hi @TWmailrec,

You may use LibreOffice on the command line to convert various document types to plaintext. Note that plaintext doesn’t have any special formatting, so you’ll want to experiment with some of your more complicated documents to see how cleverly things like bullets, tables, images, etc… are handled.

To convert a document to text, first make sure that LibreOffice isn’t currently running, then use the following on the commandline:

soffice --headless --convert-to txt:Text YOUR-DOCUMENT-HERE.DOC

(I’ve been told that on Windows you should use “-convert-to” instead of “–convert-to”; I’m not sure if the same applies to the “–headless” parameter)

For more information about using LO on the commandline, see the answers to this question: