Ask Your Question
0

Using --convert-to output to stdout?

asked 2019-01-22 18:59:30 +0100

PenguinJeff gravatar image

updated 2019-01-22 19:27:19 +0100

Currently I have a script like so:

#!/bin/bash
#usage "script.sh file.xlsx"
libreoffice --headless --convert-to html $1 2>/dev/null >/dev/null
html=$(cat ${1%.xlsx}.html)
rm ${1%.xlsx}.html
#... work with ${html}

I was just wondering if I could do this without writing the file? I didn't see an option to select an output name either that is why I use ${1%.xlsx}.html as the filename

I have people send me xlsx files that have selected background colors and I wanted to write scripts to move things around as I needed. I found libreoffice's html output to be easy to work with in my scripts and was just wondering if I could drop a couple step and save disk writes (I could always define a ramdisk and use the --outdir to point to ramdisk to stop it from writing to a real disk.)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-01-22 19:28:55 +0100

LibreOffice doesn't output documents to stdout, except for --cat option, which uses plain text filter (not HTML; not configurable).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-01-22 18:59:30 +0100

Seen: 230 times

Last updated: Jan 22