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

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog