Filter file name?

Four Stars

Filter file name?

Hi Master,
i have a file contains some string.
for example file ListFileName.csv : T001,T002,T003,T004
i need to scan a directory and read every file startsWith T001 or T002 or T003 ...
otherwise the file will be moved to other place.
how can i do this with Talend?
Thank you and best regards,
Five Stars

Re: Filter file name?

If you want to filter some of the files which starts with specific names then you can use tFileList component with "file mask" property. 
configure tFileList component as follows. 

Select directory where all the files stored. 
Add File Mask for required list of file names.  it should be like. 
"t001*"
"T002*"
"T003*"
hope this will help you.. 
Other wise you can use tFilelist -exclude mask which will exclude unwanted files. 
Four Stars

Re: Filter file name?

Thanks for your response umeshrakhe,
But i need to read ListFileName.csv first to get the list of file names.
do you have any idea?
Five Stars

Re: Filter file name?

Correct me if am wrong, you have a list of file names in ListFileName.csv file? 
If yes then you have to design job like below.. 
tFileinputDelimited_1----Main--tMap---tFileinputDelimited_2-- then process here. 

tFileinputDelimited_1 provide ListFileName.csv file path and schema. 
tMap- use output filter with below expression to get only required files. 

row1.FileName.startsWith("T001") || row1.FileName.startsWith("T002") || row1.FileName.startsWith("T003")


tFileinputDelimited_2 provide file name with required details to process input file which we are getting after filter.