我有两个具有以下 JSON 的文件,我需要使用每个对象的相对数组位置来组合它们:
PS: - 我被限制为 1.4 版本,就像在 Solaris 上一样,所以没有 [inputs] 功能
File 1
{
"input": [
{
"email": "[email protected] /cdn-cgi/l/email-protection",
"firstName": "Fred"
},
{
"email": "[email protected] /cdn-cgi/l/email-protection",
"firstName": "James"
}
]
}
File 2:
{
"result": [
{
"id": 50,
"status": "created"
},
{
"id": 51,
"status": "rejected"
}
]
}
预期结果是 input[1] 的元素与 result[1] 的元素相结合,依此类推,如下所示:
{
"combined": [
{
"email": "[email protected] /cdn-cgi/l/email-protection",
"firstName": "Fred",
"id": 50,
"status": "created"
},
{
"email": "[email protected] /cdn-cgi/l/email-protection",
"firstName": "James",
"id": 51,
"status": "rejected"
}
]
}