I have to get a file through PDI based on the filename and i want to select file with name matching pattern eligible_for_push which has to be at the end.The file can be .txt or .csv Please Help Thanks
Asked
Active
Viewed 4,659 times
1 Answers
3
There are two part to your query:
1. Finding all files ending with "eligible_for_push":
You cannot use regex to find this sort of pattern (at least i am not aware of). So as an alternate do the following:
Search all the files in the path using "Get Filename" steps. Use modified Javascript to find out the file ending with the above pattern. Check the JS file below.
2. Files can be ".txt" or ".csv":
You can use the below regex/wildcard to find choose between either .txt or .csv
.*\.txt|.*\.csv
Note : Use this code once you have filtered out the files ending with "eligible_for_push". The above JS ignore all the file patterns. After that use the second step to sort out all the .txt or .csv files.
Hope it helps :)

Rishu Shrivastava
- 3,745
- 1
- 20
- 41
-
hi, could you please let me know the reg ex that I am supposed to used for *sampleFile.csv....I am getting issue if I use .*sampleFile.csv or .\*sampleFile.csv – Ghost Rider Jun 14 '18 at 09:22
-
@Ghost Rider you can use filter steps in your case. – Rishu Shrivastava Jun 14 '18 at 13:01
-
some how it was working if I use ".*sampleFile.*.csv"...sorry for the trouble – Ghost Rider Jun 18 '18 at 10:29