Ask Your Question
0

Console App to convert to text file

asked 2012-04-03 10:46:48 +0200

TWmailrec gravatar image TWmailrec
1 1 2

updated 2012-04-03 10:48:14 +0200

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?

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

answered 2013-01-24 09:50:07 +0200

qubit gravatar image qubit flag of United States
5816 3 50 43

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:

link delete flag offensive edit
1

answered 2012-04-03 14:04:46 +0200

luyu gravatar image luyu
1038 1 8 14

updated 2012-04-03 14:06:48 +0200

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.

link delete flag offensive edit

Login/Signup to Answer

Donate

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!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-04-03 10:46:48 +0200

Seen: 355 times

Last updated: Jan 24