Answer the question
In order to leave comments, you need to log in
How to create a library office document via terminal?
Hello!
I can't create an office document through the terminal, I write, > file.odt
but in the end a plain text file is created
. How to be?
Answer the question
In order to leave comments, you need to log in
> file.odt
It's just a redirect to a file.
And what exactly do you write there - you parsed the libre office format and write data in this format, or just write text to a file and get a text file (logically?)
For a file to be libreoffice, it must be in libre office format. The contents of this file must comply with the odf standard, at a minimum.
Well, if you need to get this format from the input stream, use the pandoc utility for example. It must be installed separately, it is in the packages of the main distributions.
For example, in a hurry (requires the installed python pyodf package):
echo "Hello world" | python -c 'import sys;from odf.opendocument import OpenDocumentText;from odf.text import H, P, Span;textdoc = OpenDocumentText();p = P(text=sys.stdin.read());textdoc.text.addElement(p);textdoc.save("out.odt")'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question