Search code examples
etltalendfile-watcher

Regular expression in file path


I need to enter regular expression in a file path name inside tfileinputdelimited

I have a file watcher that is looking inside a directory for new files to be added. I want the new files have similar word for example file 1 is called apple1.csv and the other file that will be added at another time is called apple2.csv I want a way in order to tell talend to extract the file that contains the word apple, regardless of whats before or after.

Right now I have:

twaitforfile -> tflowtoiterate -> tfileinputdelimited -> tmap -> tdboutput

I believe tfileinputdelimited should have a regular expression as right now I selected a specific file

enter image description here

enter image description here


Solution

  • For the twaitforfile component, in the File Mask field specify the following: "*apple*.csv". This should grab only the files that have the word apple in them.

    enter image description here

    To dynamically grab these files base on their file names through tfileinputdelimited, you can use the FILENAME global parameter of the twaitforfile to achieve this:

    enter image description here