please help me

Advanced Renamer forum
#1 : 12/01-24 17:28
n0om
n0om
Posts: 1
Hello, I want to change the file name by Verify that there are less than 8 characters. If there are less than 8 characters, put the number 0 in front.
For example,
1234 to 00001234
a5895 to 000a5895
aoeei to 000aoeei


12/01-24 17:28 - edited 12/01-24 17:51
#2 : 22/01-24 13:18
Kim Jensen
Kim Jensen
Administrator
Posts: 906
Reply to #1:
You can use the renumber method configured like this:

Number position: 1
Change to: Relative
Number difference: 0
Zero padding: Manual
Number length: 8


22/01-24 13:18
#3 : 22/01-24 13:46
Miguel
Miguel
Posts: 136
Reply to #2:
Hi.
With letters in the name that method don´t work.




22/01-24 13:46
#4 : 22/01-24 14:29
Kim Jensen
Kim Jensen
Administrator
Posts: 906
Reply to #3:
You are right. For that I think you need to use script. The follow will work if the filename only contains one word.

var s = item.newBasename;
while (s.length < 8) {
s = '0' + s;
}
return s;


22/01-24 14:29
#5 : 28/02-24 07:31
Delta Foxtrot
Delta Foxtrot
Posts: 285
Hello,
I know it's late, but there's also the brute force method using add and replace methods

Add 8 zeros at position 1

Replace: .*(.{8})$
Replace with: \1
(use regex of course)

I couldn't tell by the original post if there might be filenames longer than 8 chars, and what needed t o be done with them.

Just noticed this thread and had to stick my big fat schozz in... :)

DF


28/02-24 07:31