Is there a way to cat
or less
a .odt file just as antiword
does for .doc files?
Ubuntu – How to “cat” or “less” a libreoffice writer .odt file
libreofficetext processing
libreofficetext processing
Is there a way to cat
or less
a .odt file just as antiword
does for .doc files?
Best Answer
The solution is using
odt2txt
. Now, this command is provided by two different packages, namely one calledodt2txt
that you can install withand by the package
unoconv
(that offers also command-line conversions between more libreoffice formats), that is installed byIf you have the two, you can switch between them using the alternative mechanism:
If you are using the
odt2txt
provided by the packageodt2txt
you just useif using the
unoconv
provided package you have to usePipe them to
less
to have a less-like experience (odt2txt file.odt | less
)Notice that if you do not use the
--stdout
option, the unoconv-provided package will write the result in a file calledfile.txt
.The suggested package by the distribution seems to be the one from the
odt2txt
package (it has a higher default priority in the alternative system); for sure it has less dependencies.