2

I am running certain commands in a loop and would like to open its output in libreoffice (calc), without storing it.

This is what I have tried:

libreoffice --calc <(process m n)
libreoffice --calc < $(process m n)
process m n | libreoffice --calc

I am getting an error in the first two, whereas for the third one, it opens libreoffice, but no file!

However if I save the output of process to a file f and open libreoffice f, it works!

Is it that I am doing something wrong, or its a limitation of libreoffice? My question is is there any way to avoid local storage?

  • 1
    Related, covers the same question for OpenOffice: https://unix.stackexchange.com/questions/91088/is-it-possible-to-feed-open-office-via-stdin – Panki May 09 '19 at 13:28

1 Answers1

0

Looks like a limitation / missing feature (?) in LibreOffice.

What I did, with test.csv being a valid CSV file :

  • libreoffice --calc test.csv : opens test.csv in "Calc" as expected
  • cat test.csv | libreoffice --calc : starts "Calc" with a blank spreadsheet

man libreoffice states :

--calc Starts with a new Calc document.

It doesn't mention reading from standard input.

Similar information here : Is it possible to feed Open Office via STDIN?

Suggestions to avoid local storage :

  • since commands building the data file are run in a loop, always write into the very same file. You'll avoid filling storage with temporary data
  • write into temporary storage areas such as /tmp
  • write into tmpfs filesystems (mount | grep tmpfs to list those. Typically /dev/shm)
Httqm
  • 1,136