Hello peoples... This is an aggravating problem for me and any help at all would be greatly appreciated.
I have an array assembled named: @MASTERLIST
Each line is thus:
$titleword1,$catnum11,$valueword1,$catname1
I need to run through the array, find matches of $catnum11 and total the $valueword1 numbers to create on line with the $catnum1 collecting all values of the $valueword1 as addition. So a large list of quite a few duplicate $catnum1's is merged and added into a much smaller list of one entry of each $catnum1 with the corresponsing $valueword1 a total of all of the same $catnum1 values.
Its identifying duplicates in the array and merging the value of those duplicates into one entry for that number of the entry.
I've tried all sorts of useless exercises including writing to tmp files and updating with reopening on each try, brute force ignorance at work..
A solution to this would be forever appreciated.
Thanks.
I have an array assembled named: @MASTERLIST
Each line is thus:
$titleword1,$catnum11,$valueword1,$catname1
I need to run through the array, find matches of $catnum11 and total the $valueword1 numbers to create on line with the $catnum1 collecting all values of the $valueword1 as addition. So a large list of quite a few duplicate $catnum1's is merged and added into a much smaller list of one entry of each $catnum1 with the corresponsing $valueword1 a total of all of the same $catnum1 values.
Its identifying duplicates in the array and merging the value of those duplicates into one entry for that number of the entry.
I've tried all sorts of useless exercises including writing to tmp files and updating with reopening on each try, brute force ignorance at work..
A solution to this would be forever appreciated.
Thanks.