Page 1 of 1

delete the old "Renames" in Rename in batch

Posted: Wed Oct 13, 2021 4:44 pm
by dardaner
we can add text in the renames but we cannot remove part of it.
for example :

I have 3 photos which are renamed as follows:
Photo 1, Photo 2, Photo 3

With the Rename batch function I add ## {Filename}
Which gives me: 01 Photo 1, 02 Photo 2, 03 Photo 3

Now if I want to go back and find my original name (Photo 1, Photo 2, Photo 3) I can no longer do it in XnView. I will always have my new name 01 Photo 1, 02 Photo 2, 03 Photo 3

is it possible to add this possibility to remove the first naming or the first characters only and to keep only the original name.
Thank you

Re: delete the old "Renames" in Rename in batch

Posted: Wed Oct 13, 2021 7:16 pm
by michel038
You can use "replace" and "use regular expression" ( without template )
First field : ^([0-9]{2})
Replace with : empty

For this regular expression, the caret ^ ... means beginning of string
[0-9] means any numeric character
{2} means two times

if yo need to remove also a space character, use a backslash before the space char at the end of the regExp ^([0-9]{2})\ (space not visible here)