Six Stars

Execute job based on file name

I am looking to automate some processes based on a files name. I have several jobs set up to execute on files within the same files. If I have a file names foo*.xls, I would like to run job fooManipulate. If the filename is bar*.xls, I am looking to run job barManipulate and so on and so forth. Is there a way to automate the process so that it iterates through each file in the folder and runs the correct job?

5 REPLIES
Five Stars

Re: Execute job based on file name

Not exactly sure of your flow but have you tried tRunJob?

Nine Stars

Re: Execute job based on file name

 

The tRunJob has an option: dynamic job , you can use a context/global variable which you set runtime while using the tFileList to check for files.

 

 

Five Stars

Re: Execute job based on file name

You can always create a dynamic instance with context or globalMap

Ten Stars

Re: Execute job based on file name

are you running on TAC or on a standalone jobs?

Francois Denis

Don't forget to tag when it's "solved"!

Ten Stars

Re: Execute job based on file name

on TAC Talend Administrtor Center you can add file triggers with mask to run your Job.

on Standalone add new job with tFileList with mask linked by iterationLink to the coresonding tRunJob. do not forget to set subjob context using globaMal("tFileList_x_CURRENTFILE").
good luck.

Francois Denis

Don't forget to tag when it's "solved"!