Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
orawajar
Contributor III
Contributor III

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,
Labels (2)
3 Replies
Anonymous
Not applicable

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. 
orawajar
Contributor III
Contributor III
Author

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?
Anonymous
Not applicable

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.