Renumbering Files from a Selection of files from a group of files

I wuld like to add about 50 files to renumber and would like to select a few a time.
For Example
I have added 10 files to be re-numbered
1
2
3
4
5
6
7
8
9
10
Out of these I first only want to choose 1,2,3,4 and 5 to be renumber as 21,22,23,24,25
the next batch 6,7,8,9,10 I want to renumber as 31,32,33,34,35
How do I do this in one batch or do I have to do it separately.
I appreciate the help to learn how to do this if someone can support me. Thank you.
Reply to #1:

Hi Mariya,

Without using javascript, the only way I know to do this is like this:

(1) RENUMBER method:
Number position: 1
Change to: Relative to existing number
Number difference: 20
Zero padding: no padding
Apply to: Name
{if}
Field: Name
Match: relative expression
Pattern: ^[1-5]$

(2) RENUMBER method:
Number position: 1
Change to: Relative to existing number
Number difference: 25
Zero padding: no padding
Apply to: Name
{if}
Field: Name
Match: relative expression
Pattern: ^[1-5]$
Not matching: CHECKED

Screenshot: https://drive.google.com/file/d/1G9kM3C8z1iAvHaFGbgeZnXbqFsS 4a2cK/view?usp=sharing

It's probably easier just to drag what you want for each change, change it, then do the next batch,
but you asked so there you go! :)

Best,
DF
Reply to #2:
Thank you so much for the knowledge and your time to explain this to me. Much appreciated. . I will try and use this methods or else just go the easier way of doing it batch by batch.
Reply to #1:

Hi Mariya, Here's how you do that in a single batch using a Script method:
(https://www.advancedrenamer.com/user_guide/v4/method_script )

Paste this code into the "function(index, item)" block and apply it:

//----------------------------------------------------
const clusterSize = 5, clusterSep = 10, newNumStart = 21;

let nameParts = item.newBasename.split (/(\d+)/); // Capture group needed
let renumbered = nameParts.map (zPart => {
let possNum = parseInt (zPart, 10) - 1;
if (isNaN (possNum) ) return zPart;

let newNumb = possNum % clusterSize + Math.floor (possNum / clusterSize) * clusterSep + newNumStart;
return String (newNumb);
} );
return renumbered.join ("");
//----------------------------------------------------

The question is vague so we had to make a lot of assumptions. That code will rename files like so:
1 --> 21
fooby2 --> fooby22
fooby_3 --> fooby_23
__4__ --> __24__
first number 5 second number 24 --> first number 25 second number 64
fooby6 --> fooby31
7 --> 32
fooby-8 --> fooby-33
9fooby --> 34fooby
fooby10__ --> fooby35__

(It renumbers clusters of digits no matter where they are in the filename. And works exactly as requested in your first post if the filename is just digits.)

Post exact details and examples if you need a different result.

Regards,
Randy