in reply to Re^2: CSV to Excel Converter
in thread CSV to Excel Converter

No, it switches to Spreadsheet::WriteExcel::Big when the incoming size is over a certain bound. I bet that adding switching to a new sheet would be an easy to add option.

I myself have never wanted that. I want a sheet to be all or nothing. If it doesn't fit, I would have to invent some logic to break up the source, instead of breaking up the destination


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: CSV to Excel Converter
by runrig (Abbot) on Sep 21, 2007 at 18:50 UTC
    It doesn't matter how big the file is. Excel has a row limit (65536), and the OP is hitting that limit. Try:
    #!/usr/bin/perl use Spreadsheet::WriteExcel; my $xls = Spreadsheet::WriteExcel->new('tmp.xls') or die "Blah: $^E"; my $ws = $xls->add_worksheet(); my $row = [1..5]; for (0..70000) { $ws->write_row($_, 0, $row); } $xls->close;
    No errors, but the spreadsheet will only have 65536 rows (maybe it depends on the version of Excel? Hey, just like we'd never need more than 640K of memory, we'd never need more than 65536 rows, would we? :-). Your script would have been a good starting point for the OP though.

    BTW, recent versions of S::WE automatically use the "Big" version when needed (so same results if you use 'Big' above).