Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my code that does this :'RXX-1' => { 'RCA 1' => '', 'key' => 'HEMJJ', 'ID' => '3345', 'stem' => '', } '' => { 'RCA 1' => '', 'key' => 'HKKJ', 'ID' => '232', }
Instead of grouping them with a column I would like to group them with the row number or any unique integer if possible.for my $row(1 ..$row_max){ my $count = 1; my @data = map { my $cell = $worksheet->get_cell($row, $_); $cell ? $cell->value() : ''; } @required_cols; foreach my $col(@values){ warn $worksheet->get_cell($row,0)->value() . $col."\n"; $details->{ $worksheet->get_cell($row,0)->value() }{$col} += shift @data if defined $worksheet->get_cell($row, 1)->value(); } }
Could I use a count in the for loop? Any help/suggestions please.'1' => { 'code' => 'RXX-1' 'RCA 1' => '', 'key' => 'HEMJJ', 'ID' => '3345', 'stem' => '', } '2' => { 'RCA 1' => '', 'key' => 'HKKJ', 'ID' => '232, 'code' => '', ..... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Group cols with row number Spreadsheet::ParseExcel perl
by roboticus (Chancellor) on Jan 27, 2015 at 18:35 UTC | |
|
Re: Group cols with row number Spreadsheet::ParseExcel perl
by poj (Abbot) on Jan 27, 2015 at 20:03 UTC |