Page 1 of 1

Renaming pairs of files

Posted: Thu Mar 14, 2024 4:41 am
by obelisk
I'm scanning really old photos and there's stuff written on the back so I end up with either a single file or a pair of files representing the front and back

I'm wondering if there's a way to easily rename these.
For example if it is a pair of files instead of saying scan101 & scan102, it would be scan101 & scan101b

for example can I select all the files that represent the reverse text. Then in the batch rename somehow it text the number which is 3 digits and reduces by 1, appends 'b'?

Re: Renaming pairs of files

Posted: Thu Mar 14, 2024 1:18 pm
by michel038
In your 1st examplei, if only files to be renamed are selected , just add a single letter "b" :
- Use only "Replace" .jpg With b.jpg
scan102.jpg > scan102b.jpg
scan104.jpg > scan104b.jpg
scan106.jpg > scan106b.jpg
...
To make it easier to select your back photos, you can add a category to them ...

Then, replace all 2b.jpg with 1b.jpg , 4b with 3b etc ... :(

-----------
"Use regular expressions" allows more precise renaming, with detailed criteria, but this doesn't apply to your example, to get scan101b instead of scan102b , because XnViewMP does not implement the use of variables in regex. Perhaps with AntRenamer ... ?

The idea would be to replace the digit near to the dot by (digit-1)b dot
example Replace ([1-9])\. With =($0 - 1)b\.
(backslash is used to escape dot)
In some softwares, $1 is used instead of $0 to designate the first match in brackets.

Re: Renaming pairs of files

Posted: Thu Mar 14, 2024 11:55 pm
by obelisk
Thanks I think I got it working in an external renamer