rocky13 has asked for the wisdom of the Perl Monks concerning the following question:
Given the following dataset in an EXCEL file: Here are three columns:
A1 10 20 A1 11 22 B1 08 09 A1 03 10 B1 15 32 B1 22 33 C1 24 34 C1 0 5 ....
I am trying to group by first column. Thus, I am trying to get the following:
A1 24 52 B1 45 74 C1 24 39
Finally, I want to achieve this result because I want to put this in a hash with the first column being the key. Something like this:
my %hash $hash{$col1} = [$col2,$col3];
More importantly, how do you group things in perl by any one column? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grouping By A Column
by roboticus (Chancellor) on Jan 27, 2011 at 02:12 UTC | |
by JavaFan (Canon) on Jan 27, 2011 at 11:35 UTC | |
by rocky13 (Acolyte) on Jan 27, 2011 at 04:29 UTC | |
by GrandFather (Saint) on Jan 27, 2011 at 06:30 UTC |