Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Deep Nested Json file consist of list and array

I have this data as below: { "grandfather":[ { "father":{"source": "hshhshh", "value": "12345"} "chorid": "10435" "mother":{"source": "hshhshh", "value": "12345"} "son":{"source": "hshhshh", "value": "12345"} "title":{"source": "hshhshh"} "daughter":{"source": "hshhshh", "value": "12345"} } { "father1":{"source": "hshhshh", "value": "12345"} "chorid1": "20435" "mother1":{"source": "hshhshh", "value": "12345"} "son1":{"source": "hshhshh", "value": "12345"} "title1":{"source": "hshhshh"} "daughter1":{"source": "hshhshh", "value": "12345"} } ] }

and want to convert the data as follows:

{ "family":{

"grandfatherofnorth":[ { "father":{"source": "hshhshh", "value": "12345"} "chor_id": "10435" "mother":{"source": "hshhshh", "value": "12345"} "son":{"source": "hshhshh", "value": "12345"} "title":{"source": "hshhshh"} "daughter":{"source": "hshhshh", "value": "12345"} } { "father1":{"source": "hshhshh", "value": "12345"} "chor_id1": "20435" "mother1":{"source": "hshhshh", "value": "12345"} "son1":{"source": "hshhshh", "value": "12345"} "title1":{"source": "hshhshh"} "daughter1":{"source": "hshhshh", "value": "12345"} } ] "newfield":{newdata here} }