Hey all,
So Iโm taking over a role for a coworker managing content for our site in AEM. We have three AEM environments: we make changes in the lower one and push it to the middle environment to test it before pushing the middle to production.
Part of the testing involves comparing JSONs between the lower and middle environments to ensure they match. Right now, we do this in Notepad++ by copying the JSON code from each environment and doing a simple compare. This is incredibly time consuming so I am looking to automate the process. Something as simple as, hereโs a list of lower/middle environment JSONs side by side; compare these and return if they match or not.
I typically work in Excel and code in VBA since itโs a program everyone in the enterprise has so thereโs no special access required. In researching Iโve noticed Python makes JSON compare pretty easy but I havenโt really seen any automated JSON compare code. Could anyone point me in the right direction?
Thanks all!
Videos
Hi All,
As a developer I have to compare multiple large JSON strings a lot of time while debugging or comparing API responses between different versions. Although there is a galaxy of json comparison tools out there, most of them either copy of each other or half baked solutions. Some of the famous ones even are not correct (*cough cough*hypertest*cough*). Most of them are filled with ads.
Thinking from first principles and design thinking, I created the best JSON comparison web app to help every developer and QA person.
Here are some of the things that stand out -
Dynamic comparison as you type/import JSON. You don't get stuck in read only mode post comparison. Keep editing/fixing while it dynamically calculates the diff.
Import multiple files or drag and drop json files into the editor.
Shows JSONPath of the value where your cursor is (separately in both editors!) Helps you keep track of where you are in large JSONs
Lets you jump to specific diff from the list or navigate using next/prev diff button
Is fast even with large JSON files
Set keybindings like VScode or Sublime text with your editor.
Others - ad free, download json (with custom name), swap left and right, ignore case, secure (all processing on client), compare multiple files on the same page by adding new "tools"
If you are a dev/QA/product person who needs to work with JSON, please try https://jsontoolbox.com/compare once and let me know your feedback.
I have two json files that contain the output of an api call to a report in our property management software from two different days. I want to see which items were added to and removed from the second file compared to the first. each file is about 100,000 lines. I tried using diff, and that does work, but It's really hard to read given the large number of differences. Is their a better or easier tool for this?
I was given about 15 large JSON files recently and decided to spin up a Splunk instance to ingest this data - Wondering what are some other tools people may use to perform analysis on multiple files?
SOF-ELK may be the next thing I use since Splunk Trial has a daily 500mb index limit
inb4 good ol grep!
One of my recent tasks involves syncing aggregated metrics from our data warehouse to a marketing platform so that the marketing team can make campaigns that target, for example, all users that made 5 or more orders in the last week.
Due to limitations with the marketing platformโs reporting api, we have to download all of the existing data at once instead of by user. This requires downloading a 1 gigabyte text file, filtering out the random attributes we didnโt write, and comparing each user with the existing data in our data warehouse.
The goal is to end up with a list of JSON objects to send to the marketing platform api that only contain the changed attributes because the platform charges us by the attribute.
Whatโs the best way to compare two giant lists of json objects by user id and only return the attributes that are different?
Right now Iโm loading both into pandas dataframes and running a comparison, but it eats up a ton of memory and takes a while.
There is the "Compare" plugin. You can install it via Plugins -> Plugins Admin... (or Plugins -> Plugins Manager in older versions of Notepad++) in the top menu.
Alternatively you can install a specialized file compare software like WinMerge.
Update:
- for Notepad++ 7.5 and above use Compare v2.0.0
- for Notepad++ 7.7 and above use Compare v2.0.0 for Notepad++ 7.7, if you need to install manually follow the description below, otherwise use "Plugin Admin".
I use Compare plugin 2 for notepad++ 7.5 and newer versions. Notepad++ 7.5 and newer versions do not have plugin manager. You have to download and install plugins manually. And YES it matters if you use 64bit or 32bit (86x).
So Keep in mind, if you use a 64-bit version of Notepad++, you should also use a 64-bit version of the plugin, and the same is valid for 32-bit.
I wrote a guideline how to install it:
- Start your Notepad++ in administrator mode.
- Press F1 to find out if your Notepad++ is 64bit or 32bit (86x), hence you need to download the correct plugin version. Download Compare-plugin 2.
- Unzip Compare-plugin in a temporary folder.
- Import the plugin from the temporary folder.
- The plugin should appear under the Plugins menu.
Note:
It is also possible to drag and drop the plugin.dllfile directly in the plugin folder.
64bit:%programfiles%\Notepad++\plugins
32bit:%programfiles(x86)%\Notepad++\plugins
Update Thanks to @TylerH for this update: Notepad++ Now has "Plugin Admin" as a replacement for the old Plugin Manager. But this method (answer) is still valid for adding plugins manually for almost any Notepad++ plugins.
Disclaimer: the link to this guideline refer to my personal website.
Is there a tool that can extract the json values to be altered in a manner less manual and more clean than using a straight text editor?
Say I have 2 json files.
#1
{
"ID": 1,
"Value": "A"
}
{
"ID": 2,
"Value": "B",
}
#2
{
"ID": 2,
"Value": "B"
},
{
"ID": 1,
"Value": "A",
}
I would like a compare that says these 2 files are the same.
Just because they are not in the same order they are not different.
Are there any tools that will tell me they are the same?
thanks
Hey everyone, I wanted to share a set of free online JSON tools I've been working on, designed to make your daily dev life a bit easier. We often deal with JSON, and I found myself constantly needing quick ways to:
โ Validate & Beautify JSON: Check for syntax errors and make unreadable JSON clean and structured.
โ๏ธ Compare JSON: Easily spot the differences between two JSON files. Super handy for API versioning or debugging!
๐ JSON Difference: Get a clear, highlighted view of what's changed between two JSON payloads. These tools are built to be super fast, private (your data stays in your browser!), and can handle even large JSON payloads without breaking a sweat. Give them a try and let me know what you think! Any feedback is highly appreciated.
Link: https://needfortools.com
Hey r/golang community,
I've been grappling with a recurring challenge in my work: comparing large, deeply nested JSON files. To tackle this, I created a CLI tool in Go that helps highlight differences between two JSON files with high precision.
The tool is relatively compact, about 200 lines of code, and handles different types of changes well, including additions, deletions, and type mismatches. However, I'm looking to improve how differences within arrays are displayed. Currently, if an item at the beginning of an array is modified or removed, all subsequent items are marked as changed, which isn't very helpful for quick analysis.
Here's where I could use your collective wisdom:
Visualization Techniques: Does anyone have suggestions for more intuitive ways to display array differences? Maybe a method that effectively pinpoints and isolates changes without cascading the entire array?
Code Feedback: I'd love to get some feedback on the implementation. I'm sure there are optimizations and best practices that I could apply to enhance the tool's performance and usability.
I'm looking forward to your insights and suggestions. Let's make JSON comparisons easier for everyone!
You can check out the tool and contribute here: https://github.com/phplego/jcmp
Thank you all in advance!
I just wanted to share something with the community should somebody else find as much use in this as I have. Some time ago I put together a script that recursively compares two JSON files and returns a difference report. My primary use case for this was to validate the migration of a virtual infrastructure as defined by thousands of lines of JSON with variable depth objects. The nice thing about having a difference report generated is that I could automate any remediations required post-migration. At the time of writing this script, I couldn't find a solution that met my requirements so should such a solution exist in PowerShell, well, I at least had fun writing a recursive function. ๐
https://github.com/L-McG/PowerShell/tree/master/CompareJson
If anyone is interested, I created a video going over a script I made for comparing two JSON files and returning any differences.
Here is a link to the video: https://youtu.be/2UkDNwzhBL0
I've realized I've got about five different JSON tools saved as bookmarks in my web browser and probably only end up using two of them.
I am currently using jq on the command line for CLI work and superjson.dev for quick formatting in a web browser. I'm curious to see what other people have in their workflows with regards to formatters, validators, diff tools and anything else they find useful.