-
Hi folks .... I have a specific situation which I have 2 JSON files that have the same content but in a different order: 1st JSON:
2nd JSON file:
As you can see, both JSON files have the same content but in a different order. I would like to compare them with WINMERGE but prior the comparison I would like to reorganize the 2nd JSON to be in the same order that the 1st JSON file, so there will be no difference detected between them. Any idea will be very appreciated! best regards, JR |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 4 replies
-
WinMerge has an Unpacker plugin named QueryJSON using Specifically, specify the JSON files in the "Select Files or Folders" window and the following in the Unpacker Plugin as shown below, and press the [Compare] button.
|
Beta Was this translation helpful? Give feedback.
-
Hi Mr. Sawanaka, Wow! I deeply thank you for providing such help! I didn´t know there was a QueryJSON plugin. Super thanks also for the detailed explanation. I just used the 2 examples in the way I did to simplify the question, but to be honest the files are different than the ones I shared. I tried to replicate the way you instructed me but for some reason I failed. So, I am attaching the "real" files and I appreciate if you could give an additional help with them. As you can see, the HandleID's order is different (in the 1st FILE it begins with "HandleId": "0" and in the 2nd FILE it begins with "HandleId": "1", which avoid WinMerge to make an "usual" comparison. I would like that before the comparison, the order of the 2nd FILE be the same as the 1st FILE, I mean, moving (in the 2nd FILE) the "HandleId": "0" to the top (to be in the same order than the 1st FILE), allowing the comparison between them. The name of the files are different just to allows me to upload them and easily make reference to them (because to allow the comparison they should be the same). Again, thank you so much for your time and support! best regards, |
Beta Was this translation helpful? Give feedback.
-
The attachments appear to be valid JSON files. Therefore, the Replace plugin is not required. Please specify as below.
|
Beta Was this translation helpful? Give feedback.
-
Mr. Sawanaka, here I am again ... :) I already tried several times but all failed ... I would like that before the comparison, the order of the 2nd FILE be the same as the 1st FILE, I mean, moving (in the 2nd FILE) the corresponding objects (HandleIDs and other), allowing the comparison between them. Is it possible to take a look? Although there are several lines, just specific parts are inverted (the majority is in the same order). Best regards, |
Beta Was this translation helpful? Give feedback.
-
WOWWWWWWWWWWWWW! That was exactly what I expected Sawanka! This will help me a lot (more than 3 hours trying to achieve that!) ... Again, super thanks! Very appreciated! best regards, JR |
Beta Was this translation helpful? Give feedback.
-
Hi Mr. Sawanaka, I guess it´s the last time I will bother you with the same subject. I have another situation that both instructions above could not solve the order comparison issue: I have tried:
and also:
The 1st instruction seemed to work but it didn´t (some parts still in a different order). i have tried many alternatives but all failed. Could you kindly take a look on it, please? best regards, |
Beta Was this translation helpful? Give feedback.
-
To sort by $type, specify as follows.
|
Beta Was this translation helpful? Give feedback.
-
Oh Mr. Sawanaka, thank you so much. Now I understood the logics! Have a great day! best regards JR |
Beta Was this translation helpful? Give feedback.
The attachments appear to be valid JSON files. Therefore, the Replace plugin is not required. Please specify as below.
QueryJSON ".Data.RootChunk.renderAreaSettings.areaParameters |= sort_by(.HandleId)"