Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Out of memory and While replacements with excel XLSX application

by Anonymous Monk
on Oct 08, 2012 at 09:29 UTC ( #997792=note: print w/ replies, xml ) Need Help??


in reply to Re: Out of memory and While replacements with excel XLSX application
in thread Out of memory and While replacements with excel XLSX application

Here is a start at refactoring

diff fudge fudge2

diff fudge2 fudge3

diff fudge3 fudge4

diff fudge4 fudge5

diff fudge5 fudge6

diff fudge6 fudge7

diff fudge7 fudge8

diff fudge8 fudge9

--- fudge8 2012-10-08 01:47:28.906250000 -0700 +++ fudge9 2012-10-08 01:48:45.046875000 -0700 @@ -55,17 +55,15 @@ print "$workfile\n"; my $Book = $Excel->Workbooks->Open($workfile); -#####Work on each sheet in the workbook -#####This is the number of worksheets in the workbook my $sheetcnt = $Book->Worksheets->Count(); -#~ foreach my $r (1) { +#~ foreach my $r ( 1 .. $sheetcnt ) { { my $Sheet = $Book->Worksheets( 1 ); push @recID, $Sheet->{Name}; print "Worksheet name is $Sheet->{Name}\n"; my $Tot_Rows = $Sheet->UsedRange->Rows->{'Count'}; my $Tot_Cols = $Sheet->UsedRange->Columns->{'Count'}; - my $firstCol = eval { $Sheet->Cells( 1, 1)->{'Value'} } + my $firstCol = eval { $Sheet->Cells( 1, 1)->{'Value'} }; if( defined $firstCol and $firstCol =~ /^\d{10}$/ ) {

diff fudge9 fudge10

I end up with fudge10


Comment on Re^2: Out of memory and While replacements with excel XLSX application
Select or Download Code
Re^3: Out of memory and While replacements with excel XLSX application
by Anonymous Monk on Oct 08, 2012 at 09:41 UTC
    ValueTargetCols should loop over rows first then cols, but it probably makes no difference in the results in this case

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2014-12-18 21:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (66 votes), past polls