Dear All,
Is There Any Way to Two merge Two Json Object With Comparing Data According to if data duplicated so select the one where CreationTimeUtc,LastWriteTimeUtc and Length is greater than the second,
if json1= [
{
"CreationTimeUtc": "9/20/2015 1:38:22 PM",
"LastWriteTimeUtc": "9/20/2015 1:38:22 PM",
"Name": "test1.txt",
"Length": "1",
"owner":"pc1"
},
{
"CreationTimeUtc": "9/20/2015 1:38:16 PM",
"LastWriteTimeUtc": "9/20/2015 1:38:16 PM",
"Name": "test2.txt",
"Length": "5" ,
"owner":"pc1"
}
];
json2=
[
{
"CreationTimeUtc": "9/20/2015 1:38:22 PM",
"LastWriteTimeUtc": "9/21/2015 1:38:22 PM",
"Name": "test1.txt",
"Length": "1",
"owner":"pc2"
},
{
"CreationTimeUtc": "9/20/2015 1:38:16 PM",
"LastWriteTimeUtc": "9/20/2015 1:38:16 PM",
"Name": "test2.txt",
"Length": "4" ,
"owner":"pc2"
}
]
result=
[
{
"CreationTimeUtc": "9/20/2015 1:38:22 PM",
"LastWriteTimeUtc": "9/21/2015 1:38:22 PM",
"Name": "test1.txt",
"Length": "1",
"owner":"pc2"
},
{
"CreationTimeUtc": "9/20/2015 1:38:16 PM",
"LastWriteTimeUtc": "9/20/2015 1:38:16 PM",
"Name": "test2.txt",
"Length": "5" ,
"owner":"pc1"
}
]
Thanks