in reply to Array consolidating values

Hi, please show your code and how it fails to do what you want, not just your input and desired output (although those are needed too), else it looks like you just want someone to do your homework for you.

In general, to build up a data structure like the one you need, you loop through the raw data and update a row in a table (using a Perl hash) by either pushing a value to a list, or incrementing a counter, contained at the key corresponding to the field in the data you are looking for.

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Array consolidating values
by maikelnight (Sexton) on Oct 08, 2019 at 07:21 UTC

    I was fully aware i didnt provide code. and you can be sure that i spent hours trying to solve by myself and do homework. at least i didnt find an anchor. i just do perl at times. I would like to thank all of you. I havent tried all the solutions. the one from hauke did what i was looking for at first.