"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Angharad,
What you want to use is a high water mark algorithm per item. It would look something like this:
I have purposely left this code not working exactly as required (group is omitted) to give you something to work towards. If you need more help - remember that the entire line is stored in $_ Also, this assumes that counts will always be numeric and that they will be whitespace delimited. For something much more fancy, have a look at How A Function Becomes Higher Order Update: You didn't mention what should happen if an item has more than one group with the same highest count. The algorithm can be modified to handle the first/last/all/random values in that situation but you will need to determine what is right for you. Cheers - L~R In reply to Re: Retrieving data with largest count
by Limbic~Region
|
|