I have a list of files in which I need to select few lines which has CommonChar in them and work on creating a dictionary. The lines in a file which I am interested in look like these:
CommonChar uniqueName field value
CommonChar uniqueName field1 value1
CommonChar uniqueName1 field value
CommonChar uniqueName1 field1 value1
So with this I would want a final dictionary which will store internal dictionaries named on uniqueName and key value pairs as (field: value, field1:value1)
This way I will have a main dict with internal dict based on uniqueName and key value pairs.
Final output should look like this:
mainDic={'uniqueName': {'field':'value', 'field1':value1, 'field2':value2},
'uniqueName1':{'field':'value', 'field1':value1, 'field2':value2} }