Talend Route - cFile Component

One Star

Talend Route - cFile Component

I have a route that uses cFile component. I am struggling to specify wild card to look for files that begin with something. For example I have files in a particular folder and they are named as ABC201508011353.csv, ABC201508021401.csv,... so basically one file per day. I specified the fileName attribute as  context.fileName + "${date:now:YYYYMMDD}*.csv" so that every time a file gets created that begins with ABC and ends with YYYYMMDD*.csv where * would cater for anything that appears after YYYYMMDD, but that doesn't seem to work. Am I doing something wrong?
Moderator

Re: Talend Route - cFile Component

 
Hi,
There is built-in function in Talend:TalendDate.getDate() returns the current date.
The fileName should be:
 
"FileName"+TalendDate.getDate(yyyyMMdd)*+".csv"

Best regards

Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.