I am trying to merging hundreds of thousand JSON files that have a single object. with the help of this answer I have successfully added all objects into a single object as an array. Now I want to filter out some objects during merge if a specific field or parameter is duplicate. Something like field 1 of two objects have the same value.
Here is the example
Input File 1:
[
{
"field 1": 10,
"field 2": 25,
"field 3": 35,
"field 4": 45
}
]
Input file 2:
[
{
"field 1": 15,
"field 2": 25,
"field 3": 35,
"field 4": 45
}
]
Input file 3:
[
{
"field 1": 10,
"field 2": 20,
"field 3": 30,
"field 4": 40
}
]
Expected output:
[
{
"field 1": 10,
"field 2": 25,
"field 3": 35,
"field 4": 45
},
{
"field 1": 15,
"field 2": 25,
"field 3": 35,
"field 4": 45
}
]
The file 3 object will not merge due to having field 1 value same