Last active
September 15, 2015 08:04
-
-
Save modsaid/9437e283c4b2dd2dfe31 to your computer and use it in GitHub Desktop.
Convert batch csv files into xlsx in a single command
This file contains 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 | |
# This script uses ssconvert to convert all *.csv files in the current directory into *.xlsx format | |
command -v ssconvert >/dev/null 2>&1 || { echo >&2 "ssconvert is not installed, please install it via apt-get install gnumeric"; exit 1; } | |
find . -maxdepth 1 -name "*.csv" -exec ssconvert {} --export-type=Gnumeric_Excel:xlsx2 \; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relying on find and exec instead of loops to handle file names with spaces and other special characters