"Search and Replace Clipboard" and Calculation

Hi all,

i need the same filename or text with a counting number

for example:
img_tr.p001_1_a
img_tr.p001_2_a
img_tr.p001_3_a … and so on.

My idea is to use “Search and Replace Clipboard Using Regular Expression (case sensitive)” to search for following text:

(img_tr.p001_)(\d+)(_a)

and replace it to this:

$1%Calculate%$2+1%$3

Unfortunately it doesn’t work. Is it possible to combine “replace” and calculate?

Thanks for your help

You need to do it in two steps.

  • Search Clipboard with regular expression (img_tr.p001_)(\d+)(_a) saving the three parts into three variables (well, since two parts are constant, you can ignore those two, but its more general if you save all three).
  • Set Clipboard to Text “%Variable%One%%Calculate%Two+1%%Variable%Three%”
2 Likes

Hi peter,

Thank you so much … It works perfectly