Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

slanning (5049)

  (email not shown publicly)

Scott Lanning is currently working in Amsterdam at a hotel-booking company. The following interviews and commentaries are for entertainment only. The views and opinions expressed therein do not necessarily represent the views of his employer or even himself.

Journal of slanning (5049)

Tuesday January 27, 2009
07:48 AM

PerlIO spreadsheet2csv

[ #38348 ]
I haven't got it ready for CPAN yet, but I've recently been working on PerlIO::via::Spreadsheet (I don't like the name, but what else could I call it?). It should let you do this:

open my $fh, '<:via(Spreadsheet)', 'file.xls' or die "Couldn't open file.xls: $!";
while (<$fh>) {
    # spreadsheet emulated as an input stream is translated to CSV
    # $_ is a line of CSV;   (note: for a few minutes this was wrong, updated)

The spreadsheet would be whatever Spreadsheet::Read can deal with. Probably more a "neat to hack on" thing than something actually useful. (There are xls2csv utilities already. There are also problems with more complicated spreadsheets that aren't easily handled by a simple IO layer.)

Another idea I'm playing with is a layer to handle JSON.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.