Four Stars

Merging Data from four excel files into a single database file

Am a novice to Talend and started learning it from past few days. I have 4 excel files and I wanted to insert the data from these 4 excel files to a single database file in MSSQL.

 

1st Excel file contains - 10 rows

2nd Excel file contains - 20 rows

3rd Excel file contains - 30 rows

4th Excel file contains - 40 rows

 

The table in MSSQL should have 100 rows after the task. The column names are similar in all the files.

I have taken

 

tFileInputExcel1 -> tMap -> tMSSQLOutput

tFileInputExcel2

tFileInputExcel3

tFileInputExcel4

 

All mapped to the same tMap.

 

I just don´t know how to Map different input sources to a single tMap. I have been searching on the internet on this but I haven¨t find any relevant for my need. Can anyone here help me out on how to map tMap to a multiple input and output sources? Any posted video/text link to this is also much more appreciated.

 

Most of the links in this forum are disabled now.

 

 

3 REPLIES
Twelve Stars TRF
Twelve Stars

Re: Merging Data from four excel files into a single database file

Hi,

As explained on stackoverflow.com, try this way:

tFileList (with the appropriate file mask)-tFileInputExcel-tMap-tMSSqlOutput

or if you want just one interaction with the database:

tFileList (with the appropriate file mask)-tFileInputExcel-tMap-tHashOutput
onSubJobOk
tHashInput-tMSSqlOutput

Note the tMap is necessary only if you have to transform the input data.

With this design you get the files one after one, so you just have to map one file at a time, not 4.

 

Hope this helps.


TRF
Four Stars

Re: Merging Data from four excel files into a single database file

Thanks for the quick reply. In two of the excel sheets few of the column names are bit different than the other 2 files.

Just wanted to know still it works?
Twelve Stars TRF
Twelve Stars

Re: Merging Data from four excel files into a single database file

Don't care about columns name.
Only positions are important cause you access cells by their position, not their name.

TRF