One Star

[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
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Seeding tFileList a list of files from database

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
----------------------------------------------------------
Talend | Data Agility for Modern Business
5 REPLIES
One Star

Re: [resolved] Seeding tFileList a list of files from database

Hi
Just store the csv file into an empty directory. Then use tFileList to locate this directory and set Filemask "*".
Regards,
Pedro
One Star

Re: [resolved] Seeding tFileList a list of files from database

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.
One Star

Re: [resolved] Seeding tFileList a list of files from database

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.
One Star

Re: [resolved] Seeding tFileList a list of files from database

Yeah this is a lot better solution.
Community Manager

Re: [resolved] Seeding tFileList a list of files from database

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
----------------------------------------------------------
Talend | Data Agility for Modern Business