How do I sort-out this two dimentianal array?

  • Thread starter Thread starter Francesco2017
  • Start date Start date
F

Francesco2017

Guest
Hi all,

I have this kind of data into a two dimensional array:

cat,1

dog,2

cat,2

bird,5

giraffe,5

cat,1

dog,1

bird,1

and so-on.....

As you can see the same animal can be present multiple times in the array.

How can I sort this out, so that i get a result like;

cat,2

dog,3

bird,6

giraffe,5.

I need the result to be a list of the kind of animals and overall quantity of each of them.

I do not know which animals are in the array.

I expect the array is less then 5000 entries.

I am stuck and need your help.

Thank you.

Regards

FrancescoC

Continue reading...
 
Back
Top