我有两个 JSON 文件(file1.json和file2.json),其结构与下面定义的相同,并带有两个数组列表,如下所示。
第一个文件是(file1.json):
{
"Lists1": [
{
"point": "a",
"coordinates": [
2289.48096,
2093.48096
]
}
],
"Lists2": [
{
"point": "b",
"coordinates": [
2289.48096,
2093.48096
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
第二个文件是(file2.json):
{
"Lists1": [
{
"point": "c",
"coordinates": [
2289.48096,
2093.48096
]
}
],
"Lists2": [
{
"point": "d",
"coordinates": [
2289.48096,
2093.48096
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
所以我的预期输出将是:
{
"Lists1": [
{
"point": "a",
"coordinates": [
2289.48096,
2093.48096
]
},
{
"point": …Run Code Online (Sandbox Code Playgroud)