Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^10: Reading Excel file in perl

by Pauler (Initiate)
on Dec 12, 2012 at 10:11 UTC ( #1008476=note: print w/ replies, xml ) Need Help??


in reply to Re^9: Reading Excel file in perl
in thread Reading Excel file in perl

Hi Guys , Thanks for all the help. I have got the solution for reading only 1 column value via perl.

foreach my $sheet (@{$excel->{Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet->{MaxRow} ||= $sheet->{MinRow}; $rowCnt = $sheet->{MinRow}; foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) { $sheet->{MaxCol} ||= $sheet->{MinCol}; $colCnt = $sheet->{MinCol}; foreach my $col ($sheet->{MinCol} .. $sheet->{MaxCol}) { my $cell = $sheet->{Cells}[$row][$col]->{Val}; if ( $cell eq "Column Heading" ) { $val_col=$col; print "OKAY: found column values as below\n"; my $res = $sheet->{Cells}[$rowCnt][$col]->{Val}; #Read +s each value for the column print $res, "\n"; next; } if ($val_col eq $col ) { print $cell, "\n"; push (@col_arr, $cell); } foreach $cell (@data){ print "into new loop\n"; } } } }
Thanks


Comment on Re^10: Reading Excel file in perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-08-23 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls