Rename: add sequental numbering to files, but start with 01 for each group with same name

I have a number of files that start with normal filenames but end up with (a lot) numbers, some underscores and some text.
The numbers and underscores are stripped (regex)
So the 'normal filenames' remain.

When sorted, many filenames are identical.

I'd like to add a sequence number to the filenames to make them unique again.

However, for each group of same files the counter should start at 01 again, i.e. no number 01,02,03.... 30,31...etc. but instead
if there are, for instance, 4 groups, of 6 files, it'll read 01,02...06, next group 01,02..06, etc.

So, add sequental numbering to files, but start with 01 for each group with same name.

Like below.


Any suggestions?


Later... it is like when in the above 'sequential numbering' is untagged, but then again, obviously one does not have controle over the numbering, i.e. layout.

This should do what you want: Add a Unique Number while renaming

Like this?


[NUM] shouldn't be appearing in the list of new names at the bottom, unless you just need to click Refresh Preview.

Looking again, it appears you have edited the script (from the small portion visible in the screenshot), and what I can see is not valid VBScript and would not work.

Why did you edit it, and have you tried with the original?

Sorry, my mistake, I assumed I had to add "NUM" etc. there, but that is - I confess - wrong.
I reloaded the script.

This is what I got.


Otherwise, how should I proceed?


That looks right now. The numbers are based on which files currently exist, so the preview will show 001 (unless 001 already exists in the directory), but when the rename actually happens, only the first file in each group will get 001, and the existence of that file will then cause the second file to get 002, and so on.

Ah right, it was in the description but with all the trying and so on I forgot.


Thank you so much, this really helps and saves a lot of work...
Again, many thanks!