Can we compare a column from two different files in tFileCompare?

Highlighted
Five Stars

Can we compare a column from two different files in tFileCompare?

I'm trying to compare a column between a source(.txt) and a reference file(.xlsx) and send a notification email(if differences detected) before running a Job. Is this possible to do with tFileCompare ? Or do I need to have same schema for both the files to compare in tFileCompare?
If it can't be done through tFilecompare, Is there any other simple way to compare the files and send a notification email based on the file comparison?


Accepted Solutions
Employee

Re: Can we compare a column from two different files in tFileCompare?

Hi,

 

    One way is to extract the required columns from both file and write them to temp file and then do file comparison using tFileCompare. Please note that all the records must be in same order in both files and even an extra space will change the result of comparison.

 

    Another way is to read the first file and second file based on inner join on both result sets in tMap. In the output section, activate the boolean value to catch inner join reject records as true. If there is even one record in output section, it means that records from both files are not perfect match!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved


All Replies
Employee

Re: Can we compare a column from two different files in tFileCompare?

Hi,

 

    One way is to extract the required columns from both file and write them to temp file and then do file comparison using tFileCompare. Please note that all the records must be in same order in both files and even an extra space will change the result of comparison.

 

    Another way is to read the first file and second file based on inner join on both result sets in tMap. In the output section, activate the boolean value to catch inner join reject records as true. If there is even one record in output section, it means that records from both files are not perfect match!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog