Hello!
I'm not the best programmer in the world - far from it, actually - but I'm making a small program to read in a text-file and output it in a specific format for the danish customs authorities.
Basic format is:
02,date,ourCompanyNumber,CountryCodeForBuyer,BuyersCompanyNumber,amount
The catch is that the BuyersCompanyNumber may exist several times in the input file, but it's only allowed to exist once in the output-file.
Example:
02,2010-10-10,12345678,US,12341234,1000
02,2010-10-10,12345678,US,12341234,5000
Those would have to be fitted together to one line with the amount being 6000. They can be present at random places in the input-file.
Each line is saved in a string-array, but I'm uncertain how I would go about checking if the buyers company-number already exists in my array - and if it does, how I would add together the amounts.
Hope I've made myself understandable - if not, please give me a shout
BR
Thomas
I'm not the best programmer in the world - far from it, actually - but I'm making a small program to read in a text-file and output it in a specific format for the danish customs authorities.
Basic format is:
02,date,ourCompanyNumber,CountryCodeForBuyer,BuyersCompanyNumber,amount
The catch is that the BuyersCompanyNumber may exist several times in the input file, but it's only allowed to exist once in the output-file.
Example:
02,2010-10-10,12345678,US,12341234,1000
02,2010-10-10,12345678,US,12341234,5000
Those would have to be fitted together to one line with the amount being 6000. They can be present at random places in the input-file.
Each line is saved in a string-array, but I'm uncertain how I would go about checking if the buyers company-number already exists in my array - and if it does, how I would add together the amounts.
Hope I've made myself understandable - if not, please give me a shout
BR
Thomas