To keep as close contact to spreadsheet users, row and column 1 have index 1 too in the cell element of the sheet hash, so cell "A1" is the same as cell [1, 1] (column first). To switch between the two, there are two helper functions available: cell2cr () and cr2cell ().

Set the format for M$Excel date fields that are set to use the default date format. The default format in Excel is 'm-d-yy', which is both not year 2000 safe, nor very useful. The default is now 'yyyy-mm-dd', which is more ISO-like.

Note that date formatting in M$Excel is not reliable at all, as it will store/replace/change the date field separator in already stored formats if you change your locale settings. So the above mentioned default can be either "m-d-yy" OR "m/d/yy" depending on what that specific character happened to be at the time the user saved the file.

debug

Enable some diagnostic messages to STDERR.

The value determines how much diagnostics are dumped (using Data::Peek). A value of 9 and higher will dump the entire structure from the back-end parser.

All other attributes/options will be passed to the underlying parser if that parser supports attributes.

Using CSV

In case of CSV parsing, ReadData () will use the first line of the file to auto-detect the separation character if the first argument is a file and both sep and quote are not passed as attributes. Text::CSV_XS (or Text::CSV_PP) is able to automatically detect and use \r line endings).

CSV can parse streams too, but be sure to pass sep and/or quote if these do not match the default , and ".

When an error is found in the CSV, it is automatically reported (to STDERR). The structure will store the error in $ss->[0]{error} as anonymous list returned by $csv->error_diag. See Text::CSV_XS for documentation.

ss2tk

xls2csv

Convert a spreadsheet to CSV. This is just a small wrapper over xlscat.

usage: xls2csv [ -o file.csv ] file.xls

TODO

Options

Module Options

New Spreadsheet::Read options are bound to happen. I'm thinking of an option that disables the reading of the data entirely to speed up an index request (how many sheets/fields/columns). See xlscat -i.

Parser options

Try to transparently support as many options as the encapsulated modules support regarding (un)formatted values, (date) formats, hidden columns rows or fields etc. These could be implemented like attr above but names meta, or just be new values in the attr hashes.

Other spreadsheet formats

I consider adding any spreadsheet interface that offers a usable API.

Add an OO interface

Consider making the ref an object, though I currently don't see the big advantage (yet). Maybe I'll make it so that it is a hybrid functional / OO interface.

http://metacpan.org/release/Spreadsheet-ConvertAA for an alternative set of cell2cr () / cr2cell () pair

Spreadsheet::Perl

http://metacpan.org/release/Spreadsheet-Perl offers a Pure Perl implementation of a spreadsheet engine. Users that want this format to be supported in Spreadsheet::Read are hereby motivated to offer patches. It's not high on my TODO-list.

xls2csv

http://metacpan.org/release/xls2csv offers an alternative for my xlscat -c, in the xls2csv tool, but this tool focuses on character encoding transparency, and requires some other modules.

AUTHOR

H.Merijn Brand, <h.m.brand@xs4all.nl>

COPYRIGHT AND LICENSE

Copyright (C) 2005-2014 H.Merijn Brand

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Module Install Instructions

To install Spreadsheet::Read, simply copy and paste either of the commands in to your terminal