Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

how to check if filename contains any digit/numeric in it

avatar
Explorer

For routeonattribute I need to check if filename contains any date (any number ) in it

How to check this?

2 REPLIES 2

avatar
Super Guru

Hi,

If you want to check for number match in the routeOnAttribute. You can create dynamic property called for example "filenameHasNumeric" and set the value to the following expression "${filename:matches('.*\d+.*')}". You can set the routing strategy to  "Route to 'matched' if all matches" to get "matched" or "unmatched" relationships. If that solves the problem please accept it as solution. Thanks

avatar
Master Mentor

@Elsaa 
Is it a standardized filename structure with a standardized date format?
Can you share examples?

Thanks,

Matt