First time here? Check out the FAQ!
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?
answered 2013-01-24 09:50:07 +0200qubit
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:
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.
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-04-03 10:46:48 +0200
Seen: 331 times
Last updated: Jan 24