Accidentally number renamed without padding

Bulk Rename Utility How-To's

Accidentally number renamed without padding

Postby DKDiveDude » Tue Jul 09, 2024 9:57 pm

I accidentally renamed a bunch of files, using "Numbering". Problem is I forgot to use "Pad" = 2.

Now I got files like the examples below. Besides the tedious way of manually renaming all the 1-digit files, is there an easier way?

file-a-1
...
file-a-9
file-a-10
...
file-a-99

and

file-b-1
...
file-b-9
file-b-10
...
file-b-99
DKDiveDude
 
Posts: 7
Joined: Tue Jul 09, 2024 9:52 pm

Pad names like "file-a-1"

Postby Luuk » Wed Jul 10, 2024 12:46 am

For the examples, RegEx(1) can use a "Match" and "Replace" like...
^(file-[a-z]-)(\d)$
\10\2

NowName --> NewName
file-a-1 ----> file-a-01
file-b-2 ----> file-b-02
file-z-3 ----> file-z-03
file-a-99 --> (not renamed)
file-b-11 --> (not renamed)
file-bb-1 --> (not renamed)
text-a-1 ---> (not renamed)

Related posts for padding the numbers...
http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=6100#p16913
http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=12&t=6376
http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=6487
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm

Re: Accidentally number renamed without padding

Postby DKDiveDude » Wed Jul 10, 2024 3:03 pm

Thank you very much for you time offering a solution.

Not your fault, but the solution you offered did not work. It is because I did not provide an accurate enough example of my filenames.

They are actually more like this;

Cat1 - 1912 - 1.jpg
..
Cat1 - 1912 - 10.jpg
..
Cat1 - 1912 - 99.jpg


Cat1 - 2465 - 1.jpg
..
Cat1 - 2465 - 10.jpg
..
Cat1 - 2465 - 99.jpg
DKDiveDude
 
Posts: 7
Joined: Tue Jul 09, 2024 9:52 pm

Re: Accidentally number renamed without padding

Postby DKDiveDude » Wed Jul 10, 2024 3:21 pm

Ok it seems I found a solution to rename more easily than manually!

In the Menu; "Display Options", "Sorting", I selected "Logical Sorting".

Then the files at least shows in the order
...1
...2
...10

instead of

...1
...10
...2

and then it is easy to use "Numbering" again to rename a batch at a time, to correct my error!
DKDiveDude
 
Posts: 7
Joined: Tue Jul 09, 2024 9:52 pm

Pad names ending with a number

Postby Luuk » Wed Jul 10, 2024 7:42 pm

Yes, the answers should always be based on example Now-names ---> New-names.
To pad the latest examples, Regex(1) needs a "Match" and "Replace" more like...
^(Cat\d+ - \d+ - )(\d)$
\10\2

To pad names ending with a space, then 1-digit, its like...
^(.+ )(\d)$
\10\2

To pad any names ending with only 1-digit, its like...
^(.+[^\d])(\d)$
\10\2
Luuk
 
Posts: 811
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To