Currently, I am dealing with a JSON file that contains multiple sets of data structured like this:
{"name": ["Adelphi University"], "supp": ["Yes: E, WS"], "ed": ["\u00a0"], "online": ["$40"], "ea": ["12/1"], "mid": ["No"], "rd": ["Rolling"], "recs": ["Yes: CR"], "mail": ["$40"], "schoolr": ["Yes"]}
The intention is for this line to represent a university (hence the name) with other variables like "supp", "online", etc. as attributes of that school. My goal is to restructure this data so that the "name" variable defines the data and the other variables become children of the "name" parent. The desired format of my data should be:
{
"schools": {
"Adelphi University": {
"supp": "Yes: E, WS",
"ed": "\u00a0",
"online": "$40",
"ea": "12/1",
"mid": "No",
"rd": "Rolling",
"recs": "Yes: CR",
"mail": "$40",
"schoolr": "Yes",
},
"Dartmouth College": { ... },
"Harvard University": { ... }
}
}
I am seeking guidance on how to achieve this restructuring. Can someone assist me with this?