I want to be able to easily show a simple text-only representation of a spreadsheet (Calc or Excel) via the command line (so I can pipe that output to usual Linux text manipulation tools). Is there a tool or quick way of accomplishing that?
Here's an example of how such output could look like:
A B C D E
Sales Month
1000 Jan
5000 Feb
8000 Mar
2300 Total
Best Answer
You could use unoconv to transform the Calc sheet into csv. But unoconv seems to be quite instable, i didn't manage to get it working on a simple ods (calc) file.
A better choice is jodconverter. It's available in universe, so you can install it using
apt
. Jodconverter requires an instance of openoffice running and listening on port 8100.To "manually" convert this sheet
from ods to csv:
The resulting csv will look like this:
If you don't need the table structure but just the contents for indexing purposes, take a look at odt2txt. It seems to be able to handle ods files, too, but it won't preserve the table structure. It doesn't require q soffice process running. With the sheet shown above, you will receive the following output: