Help me to Rename file 1 -> ex1; 2 ->ex1A; 3 ->ex1B; 4->ex1C; 5->ex1D, 6->ex2, 7->ex2A,....

Advanced Renamer forum
#1 : 09/03-20 11:33
jack nguyen
jack nguyen
Posts: 2
Can you help me rename like this

1 -> ex1
2 ->ex1A
3 ->ex1B
4->ex1C
5->ex1D
6->ex2
7->ex2A
8->ex2B
9->ex2C
10->ex2D
11->ex3
....
....
....
15->ex4
16->ex4A
......
20->ex5
....

Thank you so much


09/03-20 11:33 - edited 09/03-20 11:49
#2 : 09/03-20 20:39
David Lee
David Lee
Posts: 365
The following script will do what you ask:

n = item.name;
m = Math.ceil(n / 4);
a = (n - 1) % 5;
b = (a) ? String.fromCharCode(a + 64) : " ";
return "ex" + m + b;

This assumes that your filenames are simple numbers, as in your example.
If not then you will have to be more specific.


09/03-20 20:39
#3 : 15/03-20 06:27
jack nguyen
jack nguyen
Posts: 2
Reply to #2:
thank you so much


15/03-20 06:27