Just trying the example 4 in "Use regular expressions in Enfocus Switch" in Youtube.
1. For the job file "B412344_6.pdf" wants to change into B412344_p006.pdf
using "Rename Job" Element,
search : [Job.NameProper:Search="_\d{1}$"]
and replace: p00[Job.NameProper:Search="\d{1}$"]
2. For the job file "B412344_26.pdf" wants to change into B412344_p026.pdf
using "Rename Job" Element,
search : [Job.NameProper:Search="_\d{2}$"]
and replace: p0[Job.NameProper:Search="\d{2}$"]
3. I found that I can work fine if I use 2 different Rename Job Element.
( In my screen dump, Input folder "1 digit", "2 digit")
4. However, if I put them together as Action 1 for 1 digit, Action 2 for 2 digit, or vice versa. The jobs will go to problem job with error "Dynamic property "SearchFor1 (or 2)" has invalid value."
(In my screen dump, Input folder is "F_1-digit, S_2-digit" and "F_2 digit, S-digit")
So I would like to see any mistakes being made.
Thank you in advance!
Rename Job by Regular Expression
Rename Job by Regular Expression
- Attachments
-
- 1-Flow diagram.JPG (58.01 KiB) Viewed 3775 times
Re: Rename Job by Regular Expression
You must understand that Action 1 is carried out before Action 2. This means that Action 1 will change the name of "B412344_26.pdf" to "B412344_p006.pdf. When Action 2 is run, the first character after the underscore is no longer a digit (it's "p") and Action 2 will do nothing:
I'm not an expert in RegEx but you will need to test for the number of digits after the underscore before carrying out the Action.
I'm not an expert in RegEx but you will need to test for the number of digits after the underscore before carrying out the Action.