anacreon wrote:Hi all,
I am completely new to this, searched in the forum but did not find exactly what I was looking for and would appreciate some insight.
I have mixed name formats in a folder:
ABC_001
ABC_01a
ABC_01b
etc...
I need to rename them to be consistent:
ABC_1
ABC_2
ABC_3
etc.
while keeping the initial order though. Any ideas?
Thank you so much in advance!!
For such tasks you will need to use a script, where you can say:
"as long as the first name part is the same, increase the count, else set back to zero"
Something like this JavaScript code:
-----------------8<---------------------- CODE:
if(index < 1) vLastName='xxx';
//will match (A151946_) and (101_12) out of "A151946_101_12.jpg"
vNewName= item.name.replace(/(.+?_).+/, '$1');
if(vNewName!=vLastName) vCounter=0;
vLastName=vNewName;
vCounter++; vCounter=('000'+vCounter).slice(-2);
return vNewName+vCounter;
/CODE ----------------->8----------------------
http://www.advancedrenamer.com/forum_thread?forum_id=1891
FROM:
A151946_101_12.jpg
A151946_201_12.jpg
A151946_A01_12.jpg
F1298393_501_83.jpg
F1298393_F01_83.jpg
F1298393_E01_83.jpg
TO:
A151946_01.jpg
A151946_02.jpg
A151946_03.jpg
F1298393_01.jpg
F1298393_02.jpg
F1298393_03.jpg