I have some dictionaries in two different text files. I have to open the text files and read them and then merge the three dictionaries. Somehow I cannot use update to merge these three dictionaries. The merging should be such where similar keys are added for example CCG in car1 and car2 should be summed.
So basically the data in text files are as follows:
TEXTFILE1
car1=[DictX= [{'ID':'AAT','Num': 7, 'ID':'CCG','Num': 45}]
car2=[DictZ= [{'ID':'CCG','Num': 10, 'ID':'TTT','Num': 8, 'ID':'ATU','Num': 14}]
TEXTFILE2 car3=[DictD= [{'ID':'GHA','Num': 85, 'ID':'TTT','Num': 2, 'ID':'ATU','Num': 0}]