Below are my two json file with same kind of records. As you can see it, in one file there are 3 items and in other file there are 5 items. I want those two additional items in another file.
Is there a way to compare two json files and get the additional values in the other file in python?
I found some questions related to comparing two files biut tey justgive the boolean value true or false as the result. Link to the question
===> file a.json
{
"Count" : 3,
"Items": [
{
"id" : { "S" : "1" },
"name" : { "S" : "abc"},
"email" : { "S" : "abc@gmail.com"}
},
{
"id" : { "S" : "2" },
"name" : { "S" : "def"},
"email" : { "S" : "def@gmail.com"}
},
{
"id" : { "S" : "3" },
"name" : { "S" : "ghi"},
"email" : { "S" : "ghi@gmail.com"}
}
],
"ScannedCount" : 3
}
===> file b.json
{
"Count" : 5,
"Items": [
{
"id" : { "S" : "1" },
"name" : { "S" : "abc"},
"email" : { "S" : "abc@gmail.com"}
},
{
"id" : { "S" : "2" },
"name" : { "S" : "def"},
"email" : { "S" : "def@gmail.com"}
},
{
"id" : { "S" : "3" },
"name" : { "S" : "ghi"},
"email" : { "S" : "ghi@gmail.com"}
},
{
"id" : { "S" : "4" },
"name" : { "S" : "jkl"},
"email" : { "S" : "jkl@gmail.com"}
},
{
"id" : { "S" : "5" },
"name" : { "S" : "mno"},
"email" : { "S" : "mno@gmail.com"}
}
],
"ScannedCount" : 5
}