Page 1 of 1

Parameterization of variables with rename and the use of a regular expression.

Posted: 18 Aug 2022 17:02
by Nobug
My problem:
With a folder "Foldername1" selected and with the Modified Date: 06-16-2022
$mydigit = "7"; rename r, "^(.*?)(\d*)$ > $1$2+1$mydigit($mydigit+1)<space><curname> <datem dd> <datem mm> <datem yyyy> <curlen> <prop #empty> <prop #nosubs>",p;
I get:
Foldername1+17(7+1) Foldername1 16 06 2022 21 2 2
I would like add "1" to the last digit "1". Changing it in a "2"
incr $mydigit offer well a "8" value.
A mistake in my writting script?
A solution, is possible on using "renameitem" and "regexreplace" , I have found it on forum.
So, may be it's not actually able with currents options of "rename".
What are options for the first group $1 "Foldername" and the next $2 "1"?
$Incr $2 or eval ($2+1) are not also valid.
Thanks

Re: Parameterization of variables with rename and the use of a regular expression.

Posted: 18 Aug 2022 17:21
by highend
Not possible, use regexreplace + renameitem