[resolved] Seeding tFileList a list of files from database
I am trying to seed tFileList a list of files that I pulled from a table using Talend java. How can I dynamically set this up? It looks like I have to manually add in the file names to tFileList. Can I feed in a csv file? In example: Grab file names from a database >> store it in a csv file >> feed it to tFileList
Hi
If you pull the file name (or file path) from database, not the file itself, you can iterate each file name directly without tFileList component. For example:
tMysqlInput--row1--tFlowToIterate---iterate-->the rest of job.
On the rest of job, you can access the current file name (or file path), use this expression:
(String)globalMap.get("row1.filename")
//filename is the column name;
Best regards
Shong
This doesnt actually process the raw data files. It only processes the csv file which holds the name of each file to be processed. I am trying to feed tFileList a csv which contains targeted set of files for processing.
give this a try:
tFileInput--row-->flowToIterate-->tFileInput---row--->(rest of job)
the first file input should contain your filenames. you retrieve them from the iterate with a call to the globalMap.
Hi
If you pull the file name (or file path) from database, not the file itself, you can iterate each file name directly without tFileList component. For example:
tMysqlInput--row1--tFlowToIterate---iterate-->the rest of job.
On the rest of job, you can access the current file name (or file path), use this expression:
(String)globalMap.get("row1.filename")
//filename is the column name;
Best regards
Shong