If that is your primary goal, have you ever considered Spreadsheet::Read? It is a wrapper over the most common used Spreadsheet read/parse modules, including Spreadsheet::ParseExcel, and comes with a nice utility called xlscat, which can convert any selection from your spreadsheet to CSV using Text::CSV_XS. It also accepts .ods, .sxc, .csv, and .xlsx if the corresponding parsers are installed.
$ xlscat --help
usage: xlscat [-s <sep>] [-L] [-n] [-A] [-u] [ Selection ] file.xls
[-c | -m] [-u] [ Selection ] file.xls
-i [ -S sheets ] file.xls
Generic options:
-v[#] Set verbose level (xlscat)
-d[#] Set debug level (Spreadsheet::Read)
-u Use unformatted values
--noclip Do not strip empty sheets and
trailing empty rows and columns
-e <enc> Set encoding for input and output
-b <enc> Set encoding for input
-a <enc> Set encoding for output
Input CSV:
--in-sep=c Set input sep_char for CSV
Input XLS:
--dtfmt=fmt Specify the default date format to replace 'm-d-yy'
the default replacement is 'yyyy-mm-dd'
Output Text (default):
-s <sep> Use separator <sep>. Default '|', \n allowed
-L Line up the columns
-n Number lines (prefix with column number)
-A Show field attributes in ANSI escapes
Output Index only:
-i Show sheet names and size only
Output CSV:
-c Output CSV, separator = ','
-m Output CSV, separator = ';'
Output HTML:
-H Output HTML
Selection:
-S <sheets> Only print sheets <sheets>. 'all' is a valid set
Default only prints the first sheet
-R <rows> Only print rows <rows>. Default is 'all'
-C <cols> Only print columns <cols>. Default is 'all'
-F <flds> Only fields <flds> e.g. -FA3,B16
Enjoy, Have FUN! H.Merijn
|