Deep Nested Json file consist of list and array

asked 2020-05-21 01:12:16 -0500

anonymous user

Anonymous

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} }

edit retag flag offensive close merge delete