Last active
March 4, 2021 04:03
-
-
Save stami/84547b5cd55da4a6498c to your computer and use it in GitHub Desktop.
Bash Unoconv Libreoffice CSV-to-Excel converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Huikee CSV-to-XLSX konvertteri by Samuli | |
# Versio 2.0, using unoconv | |
# Unicode now works | |
root_dir=$(pwd) | |
FOLDERS=$(find $root_dir -type d) | |
for fol in $FOLDERS | |
do | |
cd $fol | |
echo 'Fol: ' $fol | |
for file in *.csv | |
do | |
echo $file | |
unoconv -d spreadsheet -f xls -i FilterOptions=44,34 -o $fol/ $file | |
# FilterOptions | |
# 44 for field separator ',' | |
# 34 for text delimiter '"' | |
# (76 for encoding UTF-8) | |
done | |
done | |
cd $root_dir | |
echo 'All done.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works for cyrillic utf-8 csv input!