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

Does that automaticaly wrap to a second worksheet when to many records are added?


___________
Eric Hodges

Replies are listed 'Best First'.
Re^3: CSV to Excel Converter
by Tux (Canon) on Sep 21, 2007 at 18:39 UTC

    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
      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).

Re^3: CSV to Excel Converter
by Anonymous Monk on Jan 13, 2009 at 05:07 UTC
    how to implement this code after downloading .... i know nothing bout it ...i just want to change an csv to excel properly
      And what is your definition of properly?


      holli, /regexed monk/
      yes, I can't use it either. Looks like it's programmer use only, not for everyday users.