Rev. | 0746f8606531d826d2f292018cdb460922f2948c |
---|---|
Größe | 729 Bytes |
Zeit | 2022-03-31 20:27:07 |
Autor | Lorenzo Isella |
Log Message | A script to batch convert excel files to csv. |
#!/bin/bash
# #convert pdf to png
# FILES="*.pdf"
# for F in $FILES
# do
# newname=`basename "$F".pdf`
# echo $newname
# pdftoppm "$F" -rx 300 -ry 300 "$newname.png"
# done
FILES="*.xlsx"
for F in $FILES
do
# See https://stackoverflow.com/questions/2664740/extract-file-basename-without-path-and-extension-in-bash/26753382#26753382
fbname=$(basename "$F" | cut -d. -f1)
newname=`basename "$F"`
echo $newname
echo $fbname
# pdftoppm "$F" -rx 300 -ry 300 "$newname.png"
xlsx2csv "$F" "$fbname.csv"
done
# FILES="*.xlsb"
# for F in $FILES
# do
# newname=`basename "$F"`
# echo $newname
# # pdftoppm "$F" -rx 300 -ry 300 "$newname.png"
# soffice --convert-to csv --outdir text_conversion/ $newname
# done