Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Combine 2 input files into single output WITHOUT lookup?

Highlighted
Nine Stars

Combine 2 input files into single output WITHOUT lookup?

What is the best practice to combine two differently structured input files into a single output file when there is no relationship between the two files?
The tMap component can't have multiple input files, unless you are doing a lookup, which I am not.
The tUnite component must have the same schema for both input files, which is not the case and I don't want the data to be split to multiple rows.
When I add a RowNum column to both files and use tJoin component with Include lookup columns in output column mapping for Col4, Col5, Col6 and Key Definition RowNum Lookup key attribute row2.RowNum I get the desired results.

Is there a better way to do this?


My job:
tFileInputDelimited_1  tJoin_1 tFileOutputDelimited_1
tFileInputDelimited_2

File1:
RowNum,col1,col2,col3
1,aaa,dog,blue
2,bbb,cat,green
3,ccc,bird,red

File2:
RowNum,col4,col5,col6
1,123,456,789
2,999,888,777
3,666,555,444
Desired Output:
RowNum;Col1;Col2;Col3;Col4;Col5;Col6
1;aaa;dog;blue;123;456;789
2;bbb;cat;green;999;888;777
3;ccc;bird;red;666;555;444
Highlighted
Community Manager

Re: Combine 2 input files into single output WITHOUT lookup?

Hi 
From given example, I think you just need to do an inner join based on RowNum column, and generate the output to have all of columns from file1 and file2?
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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