in reply to Spreadsheet::ParseExcel assigning the column
you can store values in a array of arrays like,
my @store; for my $worksheet ( $workbook->worksheets() ) { my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( 0.. $row_max ) { my @required_col = (0,1,2); my @values_store; for my $col(@required_col){ my $cell = $worksheet->get_cell($row, $col ); next unless $cell; print "$row, $col\n"; print $cell->value(),"\n"; #store values in a array push(@values_store, $cell->value()); # print "Unformatted = ", $cell->unformatted(), "\n"; print "\n"; } #push array ref into array push(@store, [@values_store]); } } print Dumper(\@store);
Output like:
$VAR1 = [ [ 'Test', 'Excel', 'hello' ], [ 'hello ', 'test', 'PerlMonks' ] ];
|
|---|