Last active
August 29, 2015 14:23
-
-
Save pesterhazy/bc0131c18f32daa403c9 to your computer and use it in GitHub Desktop.
csv2xls: convert CSV file to XLS (Excel 2007 format) on the command line
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
#!/usr/bin/env bash | |
# | |
# You need gnumeric installed, which provides the | |
# ssconvert tool (on Ubuntu: sudo apt-get install gnumeric) | |
# | |
# Usage: | |
# | |
# generate_csv | csv2xls > out.xls | |
set -euo pipefail | |
if [[ $# -eq 0 ]]; then | |
in=/dev/stdin | |
else | |
in="$1" | |
shift | |
fi | |
if [[ $# -eq 0 ]]; then | |
out=/dev/stdout | |
else | |
out="$1" | |
shift | |
fi | |
exec ssconvert -T Gnumeric_Excel:excel_biff8 "$in" "$out" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment