Import into a new sheet in AOO Calc from bash script

Issues with installing under all GNU/Linux Distributions
Post Reply
oonewbie13
Posts: 3
Joined: Thu May 16, 2013 2:50 pm

Import into a new sheet in AOO Calc from bash script

Post by oonewbie13 »

I would like my output from my bash script to be imported into a new sheet of oocalc.
Is this possible to do it directly from the bash shell?
OpenOffice 3.1 on CentosOS
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Import into a new sheet in oocalc from bash script

Post by Villeroy »

ODF is zipped XML. If you think you can manipulate this from a shell script, download the specs and go ahead. This is not a bash forum.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Import into a new sheet in oocalc from bash script

Post by acknak »

Hello, welcome to the community forum!

What have you tried so far?

I don't see any reason that your script can't send the output to a (text) file, then start OOo Calc with that file. It should start with the text import dialog.
AOO4/LO5 • Linux • Fedora 23
oonewbie13
Posts: 3
Joined: Thu May 16, 2013 2:50 pm

Re: Import into a new sheet in oocalc from bash script

Post by oonewbie13 »

I have tried importing a txt file, but every time I do it it opens a new oocalc rather than in a new sheet of the existing oocalc
OpenOffice 3.1 on CentosOS
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Import into a new sheet in oocalc from bash script

Post by Villeroy »

menu:Insert>SheetFromFile...
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
oonewbie13
Posts: 3
Joined: Thu May 16, 2013 2:50 pm

Re: Import into a new sheet in oocalc from bash script

Post by oonewbie13 »

Thank you, this shows me how to do it manually. I wanted to know if there was a way to do this without openning oocalc first. Possibly through a bash shell?
OpenOffice 3.1 on CentosOS
Jan_J
Posts: 167
Joined: Wed Apr 29, 2009 1:42 pm
Location: Poland

Re: Import into a new sheet in oocalc from bash script

Post by Jan_J »

Bash is good for os-level automation, but detailed tasks should be better done by specialized api-s. Here is, for instance, OpenOffice-independent API for managing OpenDocument by Python scripts: https://pypi.python.org/pypi/odfpy. Much better than reinventing the wheel in bash. Recent version modified this year. (Of course you can call a Python script from the bash script.)

// edit
Another chance is to launch OpenOffice in headless (i.e. invisible) mode as data server using UNO API. This is possible in many languages, Java, C++ and Python are among them. This solution is more “official” then the former, but it consumes more time and memory.
JJ ∙ https://forum.openoffice.org/pl/
LO (7.6) ∙ Python (3.11|3.10) ∙ Unicode 15 ∙ LᴬTEX 2ε ∙ XML ∙ Unix tools ∙ Linux (Rocky|CentOS)
Post Reply