[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

View solution in original post


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

View solution in original post

One Star

Re: [resolved] File name pattern match

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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog