Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NiFi Compare 2 xml files and create xml file with differences

Highlighted

NiFi Compare 2 xml files and create xml file with differences

New Contributor

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.

3 REPLIES 3

Re: NiFi Compare 2 xml files and create xml file with differences

Rising Star

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. 

Re: NiFi Compare 2 xml files and create xml file with differences

New Contributor

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.

Re: NiFi Compare 2 xml files and create xml file with differences

Rising Star

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 

Don't have an account?
Coming from Hortonworks? Activate your account here