Hello, I'd like to know if it's possible to manage different file format from a tFileList ?
My situation : a directory with xls, xlsx and csv files (all have the same format).
I want to iterate with tFileList with *.xls, *.xlsx and *.csv patterns and then redirect to a tFileInputDelimited or tFileInputExcel depending on file extension.
Thanks for your help !
Solved! Go to Solution.
Assuming your tFileList is called tFileList1, check the value of "((String)globalMap.get("tFileList_1_CURRENT_FILEEXTENSION"))" to decide which component must be used to read the content of the current file.
From tFileList component I'have to draw an iterate link ... to what kind of component ?
If I draw a "Execute if" link from the tFileList to a tFileInputDelimited and another to tFileInputExcel, there is no more iteration ...
You can link the Iterate to a tJava as a stub, and then draw Run If links from the tJava. The tJava basically becomes a Stub to draw links from. But you definitely needs to use iterate from the tFileList
Here's what I have done :
tFileList (with my 3 patterns)
-->runIf order#1 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("csv")-->tFileInputDelimited
-->runIf order#2 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("xls")-->tFileInputExcel
-->runIf order#3 ((String)globalMap.get("tFileList_5_CURRENT_FILEEXTENSION")).equals("xlsx")-->tFileInputExcel
When I run the job, it takes my first file (a csv), call the right branch (open with tFileInputDelimited) and stop !
Seems that iteration stops !
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables