-3

I have two json files and I want to find the difference of those files.

for eg : file1 contains below contents.

"iClasses": [{
                                "name": "C1",
                                "label": "Classifier",
                                "description": "Blueprint of all classifications in LDM",
                                "isFirstClass": true,
                                "boost": "LOW",
                                "superClasses": []
                },
//same as above it contains 5 classes like c2,c3,c4 and c5 and has their own properties like label,classifier,boost etc.
]

File2 contains only two classes which are present in file1 (let's say C1 and C2).

If I compare these two files, it should show mismatch classes (say C3,C4 and C5 and it's contents) as difference.

Is there any way to find the difference?

Pramod Karandikar
  • 5,289
  • 7
  • 43
  • 68
  • 3
    possible duplicate of [How to perform string Diffs in Java?](http://stackoverflow.com/questions/132478/how-to-perform-string-diffs-in-java) – Craig Aug 17 '15 at 12:00

1 Answers1

0

If you want to do a line by line comparison on text files you can use diff command which should available on most, if not all, unix like systems. If you are using Windows you can install cygwin.

You can use it on command line like:

diff file1 file2

For more options take a look at the output of following command

man diff

After that google is your friend.

slhsen
  • 606
  • 9
  • 21