#26 2008-03-13 16:40:52

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

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.??

Offline

#27 2008-03-13 16:49:07

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

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


Uploaded Images

Last edited by cahsohtoa (2008-03-13 16:50:26)

Offline

#28 2008-03-13 17:17:08

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

could you put a screenshot of ur job plz?

Last edited by pegaz (2008-03-13 17:17:21)

Offline

#29 2008-03-13 17:32:42

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

of course, I use 2 csv files a two output


Uploaded Images

Offline

#30 2008-03-13 18:01:14

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

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

Offline

#31 2008-03-13 18:06:50

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

check the format of your output field it must be a string

Offline

#32 2008-03-13 18:09:25

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

thank's

Offline

#33 2008-03-13 18:10:51

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

i have this as an output:

Starting job projet at 18:10 13/03/2008.
NumberFormatException For input string: ""id"
NumberFormatException For input string: ""1"
NumberFormatException For input string: ""id"
NumberFormatException For input string: ""1"
Job projet ended at 18:10 13/03/2008. [exit code=0]

Offline

#34 2008-03-13 18:17:27

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

can you put you 2 xml files and I will do it like you?

Offline

#35 2008-03-13 18:18:23

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

ok

Offline

#36 2008-03-13 18:49:36

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

I tried it and it seems working. I'll test it again tomorrow, cuz now, i've to go. Hope seeing you tomorrow.
Best regards!

Offline

#37 2008-03-13 18:51:00

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

all right see you toomorow

Offline

#38 2008-03-14 14:36:59

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

hi,
I want to test my xml file, but i've a little bit problem. I can't reach the row's id in my xml file. I've no problem to appear for instance the "NAME" in the tLogROW

<NOTE>
    <DATE>03-14-2008</DATE>
    <PROFIL ID="id_1">
        <NAME>barrons</NAME>
    </PROFIL>
    <PROFIL ID="id_2">
        <NAME>james</NAME>
    </PROFIL>
</NOTE>


thank's

Last edited by pegaz (2008-03-14 16:20:19)

Offline

#39 2008-03-14 16:50:21

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

ok I will have a look

Offline

#40 2008-03-14 17:00:02

cahsohtoa
Member
Company: AEFE
Registered: 2008-02-19
Posts: 261
Website

Re: Comparing 2 XML files

Ok I don't have any problem to have access to the ID fields.
Can you give me a screenshot of the Metadata configuration for your file (step 3)?

Last edited by cahsohtoa (2008-03-14 17:02:17)

Offline

#41 2008-03-17 13:33:08

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

i resolved my problem smile some wrong paramters... i fixed them and it's ok now!

Offline

#42 2008-03-17 14:08:49

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

the treatment of my job increases exponentially as well as my XML files contain too many rows :s
any solution?

Offline

#43 2008-03-25 16:41:07

pegaz
Member
Registered: 2008-03-05
Posts: 34

Re: Comparing 2 XML files

Hello,

Someone can help me to solve my problem?

We suppose that we have 2 xml files: file1.xml and file2.xml. Both of files have the same structure.


file1.xml:                                   |           file2.xml:
                                                |
id= 1                                         |          id= 1
first_name= MACKLEY                |           first_name=ROBINSON
last_name= bob                         |           last_name=david
                        |
                        |       id= 2
                        |           first_name=BROWN
                        |           last_name=Jenny

I need to identify the id of the added line in file2.xml and then to show the first_name and last_name.

Something like this:
id =2  | first_name=BROWN | last_name=Jenny



Regards.

Last edited by pegaz (2008-03-25 16:42:09)

Offline

Board footer

Powered by FluxBB