Switch: Increment filename (number of page) +1

Post Reply
senghaas
Newbie
Posts: 4
Joined: Tue Dec 06, 2016 1:40 pm
Location: Heilbronn

Switch: Increment filename (number of page) +1

Post by senghaas »

Hi Folks,
I have to increment the filename of PDF-Files. The Three-digit number of pages at 13th to 15th place must be incremented by one (+1).
When I use the enclosed Script (Screenshot), there is only the pure page number left.
How can I get the whole name and only count the number?

Any Idea? Thanks a lot in advance!


Original filename:
TZG161203WT_043.H00.pdf

-->

Expected filename:
TZG161203WT_044.H00.pdf
Attachments
screen_switch-flow_dateiname-um-eins-hochzaehlen_community.png
screen_switch-flow_dateiname-um-eins-hochzaehlen_community.png (55.9 KiB) Viewed 1597 times
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Re: Switch: Increment filename (number of page) +1

Post by freddyp »

You do not have to script that. Rename the name proper of the job with a search and replace. Search for the regular expression [1-9]\d*\. (1 through to 9 followed by zero or more digits followed by a dot; this is to avoid picking up the leading zeroes) and replace by [Switch.Calculation:Expression="[Job.NameProper:Search="[1-9]\d*\."]+1"]. (the dot here is not the end of the sentence, you actually have to type it as the search includes the dot, so the replace also has to add it).
Post Reply