[resolved] File name pattern match

One Star

[resolved] File name pattern match

Hello,
I have ajob which, depending on data transformed creates multiple files. My next job checks if any of the files exist and abort if at least one file exists.
I am using tFileExist to check for file name and it works fine. I want to do one check instead of checking for every file. I can include a pattern in file name to lookup multiple files, but I don't see anything in tFileExist component whcih would help me.
Please suggest how to do that in Talend.
Thank you,
Peter.

Accepted Solutions
Community Manager

Re: [resolved] File name pattern match

Hello
You can use the tFilelist component where you are able to set the pattern, eg: *.txt. With the global variable:
((Integer)globalMap.get("tFileList_1_NB_FILE")), you can know if at least one file exists or not.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] File name pattern match

Hello
You can use the tFilelist component where you are able to set the pattern, eg: *.txt. With the global variable:
((Integer)globalMap.get("tFileList_1_NB_FILE")), you can know if at least one file exists or not.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] File name pattern match

Thank you, Shong.
That's what I ended up implementing.