hi everyone, i'm trying to compare two XML files that have the same structure. My question is: How can i do to show the difference between the two XML files. Any solutions? Best regards. Pegaz
hello,
I need to compare 2 XML files. Actually, I can do this, show if the files differ or not and how many lines do they differ.
My question is: How can i identify which row do they differ and what is the id. Let's consider this example:
xml1: xml2:
id= 12 id= 12
first_name= MACKLEY first_name= MACKLEY
last_name= bob last_name= david
I want to see as a result: the 2 XML files differ/ they differ on: last_name / the id= 12
Regards.
Pegaz
I'm thinking that it would be a really good idea to developp a new component that permits to compare two files row by row. Please wait for a talend team opinion but I think it will be an option to put it into the buggtracker
i'm trying to switch to an other solution using tmap. tFileInputXML_1---------> tMap_1----------> tLogRow_1 tFileInputXML_2---------> any suggestions? thank's
Do u know how to compare two fields using tmap? and return a message saying for instence: the files differ If both of fields aren't the same and , the files are the same if they are.??
ok so it exists a solution with a tMap but it's quite heavy...
You can use the tmap if you are sure that your id won't change at any moment.
You use a filter :
for the first flow :
!row1.first_name.equals( row2.first_name)
for the second :
!row1.last_name.equals(row2.last_name )
After you can set your output fields to :
first:
"issue in id "+row1.id+" : "+row1.first_name+" different to "+row2.first_name
second:
"issue in line "+row1.id+" : "+row1.last_name+" different to "+row2.last_name
i have this error message: cannot convert string to integer when i put: "issue in line "+row1.id+" : "+row1.first_name+" different to "+row2.first_name