Six Stars

[resolved] Compare 2 files

Hi,
I've been reviewing the forum on how to compare 2 files and still can't get the desired results. Here is what I'm trying to do:
I have two csv files with the identical columns. The first input file has 4901 rows, the second has 4797 rows. I'm trying to compare the files and create a output file  that should show the rows that are not in the second file (104) rows.
I'm using the tMap and I've connected the columns of row1 to row2 and set row2 Join Model to Inner Join. On the output file I set the Catch output reject to false and the Catch lookup inner join reject to true. When I run the job, the output files contains all  of the first file 4901 rows. I want it to contain the 104 rejected rows.
Please help, what do I need to change?
Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: [resolved] Compare 2 files

Got it to work... the problem was one of the input files was delimited by ; the  other was delimited by ,
Thanks for all your help!
9 REPLIES
Moderator

Re: [resolved] Compare 2 files

Hi,
Could you please show us your tMap editor screenshot? 
I have designed a demo job to achieve your goal.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: [resolved] Compare 2 files

Hi Xdshi,
Here is my current tmap screenshot:

In your demo you use tFixedFlowInput but I don't see were I select the input file name for my CSV files? Also instead of using the tLogRow I need to send the results to a CSV output file. Can this be done? 
How should I proceed?
Thanks
Five Stars

Re: [resolved] Compare 2 files

You need to replace these example components with tFileInputDelimited and tFileOutputDelimited
Six Stars

Re: [resolved] Compare 2 files

After making the above changes this is how the job design looks and when I run it the output file still contains 4899 rows (not the 104 rejected rows). How should I proceed?

Thanks
Five Stars

Re: [resolved] Compare 2 files

Using the example that you were given, you need two outputs. One for the inner join matches and one for the rejects (the one you're looking for).
I'm also guessing that you have an outer-join not an inner join.
Go back the the example you were given.
Six Stars

Re: [resolved] Compare 2 files

tal0000/xdshi: I made adjustments and still does not work. Here are my screenshots.
Please advise.
Five Stars

Re: [resolved] Compare 2 files

You're catching output rejects. you need to catch inner join rejects (delimited 2).
As you've got nothing going to delimited 1, your join is failing for all rows which may or may not be what you're expecting.
Six Stars

Re: [resolved] Compare 2 files

Got it to work... the problem was one of the input files was delimited by ; the  other was delimited by ,
Thanks for all your help!
Moderator

Re: [resolved] Compare 2 files

Hi profuse,
Great it is fixed. Thanks for posting that this issue has been set as resolved.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.