Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Got positive experince with excel modules ?

by hawtin (Prior)
on May 04, 2011 at 08:18 UTC ( [id://902830]=note: print w/replies, xml ) Need Help??


in reply to Got positive experince with excel modules ?

I would agree with Wind about Spreadsheet::ParseExcel and Spreadsheet::WriteExcel, they are both reliable modules that do a good job of navigating round Excel files, setting cell formats and so on.

However it is more common that I just want to send out a simple table of values, for those I would use a simple CSV format (via Text::CSV or similar). On a Windows machine files with the csv extension are treated as Excel files and have the benefit of working elsewhere as well.

  • Comment on Re: Got positive experince with excel modules ?

Replies are listed 'Best First'.
Re^2: Got positive experince with excel modules ?
by Tux (Canon) on May 04, 2011 at 10:13 UTC

    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://902830]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found