I have few json files in a folder. I want a output.json file which contains file_name and person. But in the json files there may be repeated person i.e. 1,3,1,4,2. I need only the person where it repeats.
Output: "File_name": [1]
Input json:
{
"name" : {
"file_name" : "File_name"
},
"xyz": [
{
"name": "xyz",
"person": 1,
"value": [
10,
20
]
},
{
"name": "assa",
"person": 6,
"value": [
20,
40
]
},
{
"name": "sdsadas",
"person": 3,
"value": [
49,
38
]
},
{
"name": "dsd",
"person": 3,
"value": [
89,
81
]
}
]
}