我有一个这样的JSON
[
{
"MasterUrl": "https://$$$$/exodus2022/player.aspx",
"Programme": [
{
"Retirement": "2022",
"Current Team": "Bulls",
"Previous Team 1": "NA",
"Previous Team 2": "NA",
"Previous Team 3": "NA"
},
{
"Retirement": "2020",
"Current Team": "Celtics",
"Previous Team 1": "NA",
"Previous Team 2": "NA",
"Previous Team 3": "NA"
}
]
},
{
"MasterUrl": "https://$$$$/risen2022/player.aspx",
"Programme": [
{
"Current Team": "Heat",
"Current Location": "Miami",
"Previous Team 1": "NA",
"Previous Team 2": "NA",
"Previous Team 3": "NA"
},
{
"Current Team": "Cavalliers",
"Current Location": "Texas",
"Previous Team 1": "NA",
"Previous Team 2": "NA",
"Previous Team 3": "NA"
},
{
"Current Team": "Pistons",
"Current Location": "New York",
"Previous Team 1": "NA",
"Previous Team 2": "NA",
"Previous Team 3": "NA"
}
]
}
]
我需要将信息分成两个数组,一个用于@exodus2022
Masterurl下的数组,另一个用于@risen2022
Masterurl下的array.另外,我需要从URL和以前的团队数据中删除player.aspx
.
结果应该是这样的:
[
{
"Exodus2022": [
{
"MasterUrl": "https://$$$$/exodus2022",
"Programme": [
{
"Retirement": "2022",
"Current Team": "Bulls"
},
{
"Retirement": "2020",
"Current Team": "Celtics"
}
]
}
]
},
{
"Risen2022": [
{
"MasterUrl": "https://$$$$/risen2022",
"Programme": [
{
"Current Team": "HEAT",
"Current Location": "Miami"
},
{
"Current Team": "Cavalliers",
"Current Location": "Texas"
},
{
"Current Team": "Pistons",
"Current Location": "New York"
}
]
}
]
}
]
这种转变能不能一蹴而就呢?