Comparing JSON files #1191
Replies: 4 comments 4 replies
-
I haven't tried it, but there seem to be several tools for comparing JSON-like tree structures at the following URLs https://difftastic.wilfred.me.uk/tree_diffing.html By the way, what results were you expecting and what results did you get with WinMerge? Note that WinMerge has a PrettifyJSON plugin that uses jq to format a JSON file, and a QueryJSON plugin that uses jq to retrieve part of a JSON file. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I've taken a look at most of the tools mentioned on that page, and I haven't found one that gives context like WinMerge. One reason I love WinMerge (as opposed to Here's a good example of JSON that WinMerge struggles to compare: The JSON begins at the string If you download the source code for that page, and then delete everything before The content of that page currently changes about every day, so if you wait a day and download the source code again (and strip everything before Once you have JSON files from 2 different days from that site, try comparing them with WinMerge. The JSON contains an array of medications, and you'll notice that the WinMerge output is not very useful. The reason is because WinMerge doesn't understand that each array item in JSON file 1 needs to be compared to the matching array item in JSON file 2. If you're interested, here is the Even with performing this pre-WinMerge sorting by medication name, WinMerge's output does not improve enough to make the output useful. I would love to be able to compare JSON files in a meaningful way within WinMerge, or at least find an open source tool that displays context (like WinMerge) to perform this task. |
Beta Was this translation helpful? Give feedback.
-
Came here to say the same thing. Winmerge seems to want to start/end matches inside the obj rather than at the beginning of the obj. So Winmerge matches something like this:
instead of:
|
Beta Was this translation helpful? Give feedback.
-
Is there a "prediffer" for formatting the json files so that it can compare lines? |
Beta Was this translation helpful? Give feedback.
-
I thought I posted a discussion item about this before, but I don't see it. Please accept my apologies if this is a duplicate.
I want to compare JSON files. To try to accomplish this, I first use jq to sort the JSON files by the correct array elements and to pretty print the JSON.
I then try to use WinMerge to compare two JSON files pre-processed in this manner. Unfortunately, the result isn't really usable. I haven't been able to find a way to get WinMerge to recognize JSON arrays, which is needed for meaningful results.
Is there any way to use WinMerge to compare JSON files?
If not, is there a similar offline tool to compare JSON files?
BTW, I tried several different online JSON comparison tools, and all had poor results and were staggeringly slow (1+ hour to compare two 1 MB JSON files).
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions