V
V
Viktor Vsk2014-08-01 14:28:30
linux
Viktor Vsk, 2014-08-01 14:28:30

Is it possible to resave an xls\xlsx document on linux using command line API?

There are a large number of different incoming exel documents from various uncontrolled sources. Microsoft Office and LibreOffice display them correctly. But if you parse some files, for example, Roo ( https://github.com/hmcgowan/roo - gem for ruby), then some files fall out with an OLE2 signature error ... ) As I understand it, the fact is that excel files can be formed in very different ways, with a different number of additions (in the style of Microsoft Excel, comments, etc.), smart offices can display them well, and low-level tools - not so much.
Now it helps to open such a "wrong" file manually in the office (libre or microsoftware) and immediately resave it in microsoft exel 97\2003 format. And then everything works as it should.
Is it possible to do this restoring using some kind of office api?
I know that there is, for example, axlsx. Perhaps analogues of OLE, but since everything is already working and only this is left, I would like to get by with a little bloodshed and not look for new surprises

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Reshetnyak, 2014-08-01
@viktorvsk

Libre Office has a command line interface
Example:
libreoffice -headless -convert-to xls ./*.xlsx
libreoffice --headless -convert-to xls ./file.xlsx -outdir ~/Desktop
We use it here, but does not work if in the tray the icon hangs, or if the office is already running

@
@proffard, 2014-08-01
_

Try the spreadsheet gem .
Once we switched to it with Roo.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question