I have a situation where i need to split the Json Object given by back-end using the key. Here is the example of the JSON the back-end gave.
{
"answer": {
"E2": "Tony Stark",
"E3": "1",
"E4": "2",
"E6": "4",
"E8": "9120",
"E9": "01",
"F1": "Marvel",
"F2": "1",
"F4": "2",
"F6": "4",
"F8": "9120",
"F9": "01",
"G1": "02",
"G2": "02",
"G3": "02",
"H10": "Car"
}
}
Is it possible for me to split the answer into per section E, F, G and H ? Expected result to be
{
"answer": [
{
"E2": "Tony Stark",
"E3": "1",
"E4": "2",
"E6": "4",
"E8": "9120",
"E9": "01",
"sectionName": "E"
},
{
"F1": "Marvel",
"F2": "1",
"F4": "2",
"F6": "4",
"F8": "9120",
"F9": "01",
"sectionName": "F"
},
{
"G1": "02",
"G2": "02",
"G3": "02",
"sectionName": "G"
},
{
"H10": "Car",
"sectionName": "H"
}
]
}
There must be a genius out there that might be able to solve my question. Thank you so much. Any advise is appreciated.