Article 5S93Z Batch print Excel files with lp

Batch print Excel files with lp

by
Pedroski
from LinuxQuestions.org on (#5S93Z)
I have 33 Excel files I want to print.

They are all just 1 page A4 size.

I was hoping I could use the script below in bash, but I get this error from lp:

Quote:
lp: Unsupported document-format "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".
I don't really want to open each file and then click print.

Any tips please? Maybe convert to PDF??

Code:#! /bin/bash
echo "This script should print all the files in a given directory."
echo "Easiest is go to that directory first."

XLfiles="/home/pedro/winter2021/20EAP/individual_stats/*.xlsx" # local machine
# batch print Excel files

for X in $XLfiles;
do
echo "This is one of the files:"
printf $X;
printf "\n";
echo "Now sending the file to the printer ... "
lp -d "EPSON-L380-Series" $X;
done

echo "All files sent to the printer!"
echo "All done!"latest?d=yIl2AUoC8zA latest?i=x8ZiHLEpKAQ:yRzRhrP9RO8:F7zBnMy latest?i=x8ZiHLEpKAQ:yRzRhrP9RO8:V_sGLiP latest?d=qj6IDK7rITs latest?i=x8ZiHLEpKAQ:yRzRhrP9RO8:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments