- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
NiFi Compare 2 xml files and create xml file with differences
- Labels:
-
Apache NiFi
Created on
09-23-2019
09:11 AM
- last edited on
09-23-2019
08:27 PM
by
VidyaSargur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have 2 xml files that I would like to compare from yesterday and now, then make a new xml file with only the difference between the 2 xml files. This would be on 16k to 20k files daily.
I can see where I can split the file and parse, but nothing specific regarding comparing. These xml files have over 100 individual elements.
Any help / suggestion to get started would be great.
Thank you.
Created 09-23-2019 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps you are looking for something simple, but comparing XML can be quite a complex topic in general. Therefore I don't expect this to become available in the form of a standard processor.
I would recommend looking into a python script to do this, and then calling this from Nifi.
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
Created 09-23-2019 10:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
could do write of both files to a ms sql db and compare the 2 rows then generate an xml based on the difference?
please let me know.
Created 09-25-2019 09:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is slightly confusing, but if you have a Mysql query to generate the difference, then Nifi can get the data from there and convert to XML if needed.
As generating the difference seems to be the main challenge here, perhaps start by finding a way to do this, and from here it should be trivial to design the Nifi flow around this.
----
If this answers the question, consider marking this as the answer
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
