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

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
Nobug
Posts: 1
Joined: 18 Aug 2022 14:17

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

Post 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

highend
Posts: 14992
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post by highend »

Not possible, use regexreplace + renameitem
One of my scripts helped you out? Please donate via Paypal

Post Reply