I have list of JSON files. Now I intend to find all the common value pairs from all these JSON and copy it to different JSON. Also the common value pairs should be removed from all JSON's.
lets say I have a.json
, b.json
, c.json
... z.json
Now the common label value pair in all of them is
"Town" : "New York"
then, this common element should be moved to a new JSON file called common.json and also the element should be removed from all the JSON files.
An eg json file would look like:
{
"RepetitionTime": 2,
"EchoTime": 0,
"MagneticFieldStrength": 3,
"SequenceVariant": "SK",
"MRAcquisitionType": "2D",
"FlipAngle": 90,
"ScanOptions": "FS",
"SliceTiming": [[0.0025000000000000022], [0.5], [-0.030000000000000027], [0.46625], [-0.06374999999999997], [0.43375000000999997], [-0.09624999999999995], [0.40000000001], [-0.12999999999], [0.36750000001], [-0.16249999998999998], [0.333750000005], [-0.19624999999500004], [0.301250000005], [-0.228749999995], [0.26749999999999996], [-0.26249999999500007], [0.235], [-0.29500000000000004], [0.20124999999999998], [-0.32875], [0.16875000001], [-0.36124999999999996], [0.13500000001], [-0.39499999999], [0.10250000000999998], [-0.42749999999], [0.06875000000499998], [-0.46124999999500005], [0.036250000005000005]],
"SequenceName": "epfid2d1_64",
"ManufacturerModelName": "TrioTim",
"TaskName": "dis",
"ScanningSequence": "EP",
"Manufacturer": "SIEMENS"
}
I way i am thinking is too complex. I thought to take each line and of first json file and check with all other jsons.
There should be something easy and efficient. any pointers?