Renaming pairs of files

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

obelisk
Posts: 467
Joined: Fri Jan 09, 2009 9:54 am

Renaming pairs of files

Post 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'?
User avatar
michel038
XnThusiast
Posts: 1350
Joined: Tue Sep 27, 2016 8:18 am
Location: France

Re: Renaming pairs of files

Post 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.
obelisk
Posts: 467
Joined: Fri Jan 09, 2009 9:54 am

Re: Renaming pairs of files

Post by obelisk »

Thanks I think I got it working in an external renamer