in2csv: Specify inputs and outputs for Excel sheets using patterns and regular expressions
Created by: malcook
possible CLI interface:
- extend csvsql's current
--sheet
option to allow specifying multiple sheets by name using a regular expression defaulting to '*' which matches all sheets (and possibly also by index, using 'i..j,k..l' syntax). - support detecting and taking input from excel in csvsql and implement --sheet similarly as above
- extend --tables option as --tables TABLE_NAMES Specify the names of the tables to be created. The following "replacement strings" are supported {} : pathname passed to the command {.} : pathname without final extension {#} : the sheetname being processed, (only allowed for Excel input) The default TABLE_NAMES is '{.}' for non-excel input, and '{.}_{#}' for excel input. Providing --tables='{#}' will name tables after sheets alone.
- new option to in2csv, --files with similar "replacement string" processing, and a default value of '{.}_{#}.csv'
A useful way to extract all sheets from an excel workbook, say ${w}, into a directory named after the workbook, with files named after the sheets would then be:
mkdir ${w}.d
in2csv ${w} --files "${w}.d/{#}.csv"
The "replacement strings" are borrowed from "GNU Parallel' (except '{#}' which I made up) and there are a few more you might like, if you like this idea.