Skip to content

Instantly share code, notes, and snippets.

@hfs
Created November 21, 2017 13:28
Show Gist options
  • Save hfs/05118f3d666fb1fb5298065490f3b600 to your computer and use it in GitHub Desktop.
Save hfs/05118f3d666fb1fb5298065490f3b600 to your computer and use it in GitHub Desktop.
Convert CSV files with comma separator and US English decimal separator into Excel format using Libre Office
#!/bin/sh
# Convert CSV files into Excel format
# See
# https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options#Filter_Options_for_the_CSV_Filter
#
# 44 = ASCII code of »,«
# 34 = ASCII code of »"«
# UTF-8 input encoding
# 1 = Start in line 1 = first line
# Empty column options = import all as “Standard” formatted
# 1033 = Microsoft language code for US English
localc --headless --infilter="CSV:44,34,UTF-8,1,,1033" --convert-to xlsx "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment