on 2024 Feb 07 11:47 AM
Exclusion mask issue in SFTP sender channel
I have a requirement, for 2 SFTP sender channels:
1) Select only files which do not contain the string TEST anywhere in the filename(Exclusion mask )
2) Select only files containing the string TEST anywhere in the filename(File name mask)
From same source directory I need to pick the files
For the 1St case I am using Exclusion mask to exclude files such as TEST1,TEST2,TEST3,TEST4 and TEST5 I have given all these in Exclusion mask by one by one
For the 2Nd case I have given TEST1 ,TEST2 under File name mask such as .*TEST1.*
FileName: .*(dot *)
.*TEST2.*
It is working well(File name mask). But Exclusion mask is not working as expected.
I tried with couple of regex expressions but none of these are working.
Filename: .*(dot*)
(?<!TEST1).*\\.*
^(?!.*TEST1).*
Please suggest me regular expression to exclude files.
Can someone please suggest what changes I need to make in Exclusion mask to avoid picking the files?
Thanks,
Vidya
Request clarification before answering.
You could try this regular expression that uses a negative lookahead - "^((?!TEST).)*$".
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ryan,
Thanks for your immediate response i tried with given regex expression but its not working, still the files are getting processed.
I given regex as follows ^((?!526XXXXXXX11).)*$
In configuration i have given right details only as ^((?!526XXXXXXX01).)*$ sorry it was my bad i posted with some change.
My file name Eg:KAI2EOD.JG.526XXXXXXX01.20240130183258049.TXT
Please find the attached screenshot
Can you please suggest next steps?
Thanks,
Vidya.
Hi Ryan,
Now, exclusion mask is working as expected.
As i need to exclude all the files from source directory so I have given exclusion as below in source exclusion mask tab
Thank you so much for your response.
Have a quick question when we need to use negative lookahead regex for exclusion mask?
Thanks,
Vidya.
| User | Count |
|---|---|
| 22 | |
| 16 | |
| 13 | |
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.