Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear fellow Monks,
I have a list with three columns. The first one contains a list of IDs,second different values and third a value or blank (its A\t1_x\tblank). The ID is being repeated many times with different or same values. Example
A 1_x 9_z A 1_x A 1_x g_z B 2_c B 1_x 1_z C 1_x 1_z C v_x 8_z
What I would like to get is a list of IDs with corresponding number of 1_x and any non blank value in third column. So from the above example A 3,2 B 1,1 C 1,2. The list is preaty long so I though maybe I should go line by line append to hash and get the number of 1_x and any non blank string in third column? I started with appending the values in three arrays replacing blanks with NA (thought it might help). How should I tackle this to only go through the list once and not for each ID? Thanks for help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: List manipulation
by choroba (Cardinal) on May 31, 2012 at 16:25 UTC | |
by tobyink (Canon) on May 31, 2012 at 17:59 UTC | |
|
Re: List manipulation
by Not_a_Number (Prior) on May 31, 2012 at 18:47 UTC | |
|
Re: List manipulation
by kcott (Archbishop) on May 31, 2012 at 21:26 UTC | |
by Anonymous Monk on Jun 01, 2012 at 08:29 UTC |