Replace (3) Is Inserting 0's When Using Separators

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Replace (3) Is Inserting 0's When Using Separators

Postby spacev2 » Fri Oct 11, 2024 11:02 am

Bug report for the following renaming rule:

Replace (3)
Replace:
With:



Example of the file names format that were being renamed:

File Name v1
File Name v2
File Name v3
File Name v4
File Name v5
File Name v6
File Name v7
File Name v8
File Name v9
File Name v10
File Name v11
File Name v12
File Name v13
File Name v14
File Name v15
File Name v16
File Name v17
File Name v18
File Name v19
File Name v20
etc.

The objective was to remove the "v" and to add a 0 in front of 1,2,3,4,5,6,7,8,9


The renaming criteria being used is:

Replace (3)
Replace: v1|v2|v3|v4|v5|v6|v7|v8|v9|v10|v11|v12|v13|v14|v15|v16|v17|v18|v19|v20
With: 01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20


It gives this incorrect output:

File Name 01
File Name 02
File Name 03
File Name 04
File Name 05
File Name 06
File Name 07
File Name 08
File Name 09
File Name 010
File Name 011
File Name 012
File Name 013
File Name 014
File Name 015
File Name 016
File Name 017
File Name 018
File Name 019

File Name 20


The correct output should be:

File Name 01
File Name 02
File Name 03
File Name 04
File Name 05
File Name 06
File Name 07
File Name 08
File Name 09
File Name 10
File Name 11
File Name 12
File Name 13
File Name 14
File Name 15
File Name 16
File Name 17
File Name 18
File Name 19

File Name 20



Summary:

With: 01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19

These numbers seem to conflict with each other when used together with separators in the "With" parameter. For unknown reasons when the numbers 01, 02, 03, 04, 05, 06, 07, 08, 09 are used together with separators in the "With" parameter, it wants to insert a 0 in front of any numbers that start with 10, 11, 12, 13, 14, 15, 16, 17, 18, 19



Additional testing notes:
It does not seem to matter what numbers come afterwards, if the number starts with 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 it will insert a 0 in front of it.

It does NOT conflict with the following numbers:
20, 21, 22, 23, 24, 25, 26, 27, 28, 29
30, 31, 32, 33, 34, 35, 36, 37, 38, 39
40, 41, 42, 43, 44, 45, 46, 47, 48, 49
50, 51, 52, 53, 54, 55, 56, 57, 58, 59
60, 61, 62, 63, 64, 65, 66, 67, 68, 69
70, 71, 72, 73, 74, 75, 76, 77, 78, 79
80, 81, 82, 83, 84, 85, 86, 87 ,88 ,89
90, 91, 92, 93 ,94, 95, 96, 97, 98, 99
spacev2
 
Posts: 46
Joined: Fri Dec 22, 2023 10:58 pm

Re: Bug: Replace (3) Is Inserting 0's When Using Separators

Postby spacev2 » Fri Oct 11, 2024 11:15 am

Ok, so it actually does seem to be conflicting with the other numbers too, as demonstrated in the picture:

Image
spacev2
 
Posts: 46
Joined: Fri Dec 22, 2023 10:58 pm

Re: Bug: Replace (3) Is Inserting 0's When Using Separators

Postby Admin » Fri Oct 11, 2024 11:50 am

Hi!
I think the issue is that with:

Replace: v1|v2|v3|v4|v5|v6|v7|v8|v9|v10|v11|v12|v13|v14|v15|v16|v17|v18|v19|v20
With: 01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20

v10 is replaced by 01 first so it becomes 010

I think you might need to replace the higher numbers first:
e.g. v10|v11|v12|v13|v14|v15|v16|v17|v18|v19|v20 before v1|v2|v3|v4|v5|v6|v7|v8|v9

But another, maybe simpler way to try:

Replace: File Name v*
With: File Name *

Then "Pad Numbers" in Name (2) will automatically pad.

8)
Admin
Site Admin
 
Posts: 2570
Joined: Tue Mar 08, 2005 8:39 pm

Re: Bug: Replace (3) Is Inserting 0's When Using Separators

Postby spacev2 » Fri Oct 11, 2024 12:30 pm

ah ok

I thought that the separators worked in chronological order pairs as demonstrated in this picture:

Image

It would be nice if it had the option to function like this.
spacev2
 
Posts: 46
Joined: Fri Dec 22, 2023 10:58 pm

Re: Replace (3) Is Inserting 0's When Using Separators

Postby Admin » Fri Oct 11, 2024 1:00 pm

The multiple replacements work from the top (first) to bottom (last).
Admin
Site Admin
 
Posts: 2570
Joined: Tue Mar 08, 2005 8:39 pm

Re: Replace (3) Is Inserting 0's When Using Separators

Postby spacev2 » Fri Oct 11, 2024 9:38 pm

Thanks for the help and explanation.

My suggestion for the "Replace (3)" rule would be to implement a option where:

(1) A togglable option: Where the "Replace and With" parameters respect the order of characters to avoid them from interfering with characters that are being used in other separators.

or

(2) Replace: separator 1 -> matches -> With: separator 1 (follows character order and ignores all other separators)


Image
spacev2
 
Posts: 46
Joined: Fri Dec 22, 2023 10:58 pm


Return to BRU Support