LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Export text to odt file (https://www.linuxquestions.org/questions/linux-newbie-8/export-text-to-odt-file-4175423056/)

jmabusela 08-20-2012 08:57 AM

Export text to odt file
 
How does one export contents of a file to odt (Open Document Format) using bash

mreff555 08-20-2012 10:22 AM

You could save yourself a lot of time by just importing the file to odt format in open office.

Wim Sturkenboom 08-20-2012 12:16 PM

Quote:

Originally Posted by jmabusela (Post 4759153)
How does one export contents of a file to odt (Open Document Format) using bash

See http://www.jejik.com/articles/2010/0...nts_using_zip/ to get you started. You need an empty ODT document that you can unzip, manipulate (modify content.xml) and zip.

For ease of manipulation, you might want a bit of recognizable text in your 'empty' ODT document.

Quote:

Originally Posted by mreff555 (Post 4759257)
You could save yourself a lot of time by just importing the file to odt format in open office.

And if you don't have a gui?

Wim Sturkenboom 08-20-2012 01:20 PM

I have tested the steps above (using vi) and they work; I modified content.xml using vi

And http://www.linuxquestions.org/questi...script-212983/ (answers for post #4) might help to do the manipulation (or at least point you in the right direction). Or http://www.unix.com/shell-programmin...ther-file.html

mreff555 08-20-2012 02:31 PM

Quote:



And if you don't have a gui?
If you don't have a GUI, why would you want to put something in a format which requires one :)

David the H. 08-20-2012 04:08 PM

Assuming the file is something that libreoffice can handle:

Code:

libreoffice --headless --convert-to odt inputfile

Wim Sturkenboom 08-20-2012 11:40 PM

Quote:

Originally Posted by mreff555 (Post 4759460)
If you don't have a GUI, why would you want to put something in a format which requires one :)

Because e.g. you might have a server that needs to prepare documents in ODT format for users to download :)

mreff555 08-22-2012 06:05 AM

I have to admit, that is actually a pretty cool feature in openoffice.

I don't suppose there is a headless feature to turn a csv file in to an open office spreadsheet?


All times are GMT -5. The time now is 08:10 PM.