Setting a maximum number of characters

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

Setting a maximum number of characters

Postby therenamer » Thu Sep 05, 2013 12:08 am

Hi there,

Im new here! I've been trying to use BRU to rename some certain documents and I had found some issues doing it. Let me try to explain.

For example:
I have to rename these tree documents. They all must have 12 chacaracters. To do that I want to put '0' in the prefix. How can I set the maximum of 12 characters?

1013348
000204978
20233485

I dont know if I made it clear but what I was trying to say is: if a number has 7 characters I need it to has only five '0' in the prefix, if a number has 9 characters I need it to have tree '0'.

Sorry for my english and thanks in advance!
therenamer
 
Posts: 3
Joined: Wed Sep 04, 2013 11:57 pm

Re: Setting a maximum number of characters

Postby therenamer » Thu Sep 05, 2013 2:25 am

In fact Im trying to set a lenght limit. Using the exemple above this lenght limit would be 12 characters.
therenamer
 
Posts: 3
Joined: Wed Sep 04, 2013 11:57 pm

Keep the last n signs chars digits from right the end

Postby Stefan » Thu Sep 05, 2013 8:07 am

therenamer wrote:Hi there,

Im new here! I've been trying to use BRU to rename some certain documents and I had found some issues doing it. Let me try to explain.

For example:
I have to rename these tree documents. They all must have 12 chacaracters. To do that I want to put '0' in the prefix. How can I set the maximum of 12 characters?

1013348
000204978
20233485

I dont know if I made it clear but what I was trying to say is: if a number has 7 characters I need it to has only five '0' in the prefix, if a number has 9 characters I need it to have tree '0'.

Sorry for my english and thanks in advance!



Here is a idea:

Step 1: add leading zeros to every file, no matter if needed or not. Rename.
Step 2: get the last 12 signs for the 'new name' only. Rename.


ORIGIN file names:
1013348.ext
000204978.ext
20233485.ext



== STEP 1
Add(7)
Prefix: 0000000

Rename!

RESULT:
0000000000204978.ext
00000001013348.ext
000000020233485.ext




== STEP 2
Disable the "Add(7)" rule

RegEx(1)
Match: .*(.{12})
Repla: \1

Rename!

RESULT:
000000204978.ext
000001013348.ext
000020233485.ext


= DONE


You can modify at step 1 the amount of zeros to add, and on step 2 the digit '12' to any other digit.



Please wait a few seconds then submit. Thank you.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Setting a maximum number of characters

Postby therenamer » Fri Oct 04, 2013 12:38 am

Thank you so much!
therenamer
 
Posts: 3
Joined: Wed Sep 04, 2013 11:57 pm


Return to BRU Support