I looked at jmcnamara but no help! NOTE: I am hashing a sheet at a time because no where have I found it stated that absolutely the rows and columns in the xls and passed through the cell_handler are in sequential order. NOTE: When executing the below where @workbook_zip_FNS is a list of xls files I get out of memory. But when I run it on each xls file individually (in a batch file passing each xls into the script replacing the for (my $i=0;$i < scalar(@workbook_zip_FNS) ;$i++ ) iterator) then each run goes to completion without error.
my $cell_outputfh; my $xls_parser = Spreadsheet::ParseExcel->new( CellHandler => \&HH_cell_handler, NotSetCell => 1 ); for (my $i=0;$i < scalar(@workbook_zip_FNS) ;$i++ ) { open ( $cell_outputfh, ">:encoding(iso-8859-1)", $ribbon_srcgeo[$i +].".csv" ) or die " open failed on $ribbon_srcgeo[$i].csv $!"; my $workbook = $xls_parser->parse($unzipped_xls_FNS[$i]); if ( !defined $workbook ) { die $xls_parser->error(), ".\n"; } print "\n"; close $cell_outputfh; for my $worksheet ( $workbook->worksheets() ) { my $wsname=$worksheet->get_name(); print $wsname."*"; open ( $cell_outputfh, "<:encoding(iso-8859-1)", $ribbon_srcge +o[$i].".csv" ) or die " open failed on $ribbon_srcgeo[$i].csv $!"; my $HofA_sheet_rows; while (<$cell_outputfh>) { my @fields = split /","/, $_; $fields[0] =~ s/^"//; $fields[3] =~ s/"$//; if( $fields[0] eq $wsname ) { $HofA_sheet_rows{$wsname}[$fields[1]][$fields[2]] = $f +ields[3]; } } undef $HofA_sheet_rows; close $cell_outputfh; } undef $workbook; } sub HH_cell_handler { my $workbook = $_[0]; my $sheet_index = $_[1]; my $row = $_[2]; my $col = $_[3]; my $cell = $_[4]; my $worksheet = $workbook->worksheet($sheet_index); my $wsname=$worksheet->get_name(); my $value='"'.$wsname.'"'.','.'"'.$row.'"'.','.'"'.$col.'"'.','.'" +'.$cell->value().'"'."\n"; print $cell_outputfh $value; }

In reply to Re^2: memory usage Spreadsheet::ParseExcel by Anonymous Monk
in thread memory usage Spreadsheet::ParseExcel by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.