in reply to How to go about this?

Please see Markup in the Monastery. Your posting is nearly unintelligible without some structure. At them mininum edit your posting to use code-tags for your data examples.

Generally if your main data fits into memory, use a hash to store the main file contents with the number as key and the rest as string (or an array if you feel up to a HashOfArrays structure) and then update this data with the contents of the newer csv-files. That is if my guess about what you want to do is right

Further question: if 10 is one of the numbers, is it in every csv file or could there be files without the 10?