Page 1 of 1

Numbering reset after X numbers

PostPosted: Thu Feb 17, 2022 4:32 am
by XionicFire
Hi, simple question

How do Reset numbering after X files, say add 1,2,3 then 1,2,3 again and so on

So files look like:
1-2021-02-16-20-23-48
2-2021-02-16-20-23-49
3-2021-02-16-20-23-50
1-2021-02-16-20-23-51
2-2021-02-16-20-23-52
3-2021-02-16-20-23-53
1-2021-02-16-20-23-54
2-2021-02-16-20-23-55
3-2021-02-16-20-23-56
and so on

Ive tried all the options and none seem to do this, maybe im missing something? ive also searched the web and this board and nothing.
Any help is greatly apreciated.

Re: Numbering reset after X numbers

PostPosted: Thu Feb 17, 2022 4:39 am
by XionicFire
atm if i have to reset the numbers every 2 or 4 numbers ive used increasing by 4 or 5 then replacing and removing

Basically say you wanted to reset the number every 2 files, so ud go increase by 5, then the numbers would go 5,10,15,20,25 and so on, if you remove all but the last digit, you end up with 0,5,0,5,0,5,0,5,0 you can then replace the 5 for a 1 and get 0,1,0,1,0,1,0 but its a pain to have to do this in several passes and ive only figured how todo it for 2, 4 and 5 file repeat, if anyone has any idea of how to properly do this would be awesome

Re: Numbering reset after X numbers

PostPosted: Thu Feb 17, 2022 6:42 am
by Luuk
To prefix 01-, 02-, 03-, and then continue restarting the prefix like 01-, 02-, 03-, ...
Numbering(10) could use Mode==Prefix, Start==1, Pad=2, Break=1, Sep.==-, Type==Base4

The secret is making your "Pad" 1-higher than "Break", and then "Base" is 1-higher than your maximum.
Its unfortunate, but you need at least Break==1, so this does also mean that your "Pad" must be at least 2.
But you can always remove the padding later if its not to be desired, or javascript could rename without the padding.

Re: Numbering reset after X numbers

PostPosted: Thu Feb 17, 2022 6:54 am
by XionicFire
Interesting, ill give it a shot with your solution, yeah it sucks to have to remove the padding but i guess its better than no solution

Remove leading-zeroes

PostPosted: Thu Feb 17, 2022 8:06 am
by Luuk
To remove the padding from files starting like 0Digits-Text, the RegEx(1) can use a "Match" and "Replace" like...
^0*(\d+-.*)
\1

Re: Numbering reset after X numbers

PostPosted: Sun Feb 20, 2022 8:28 pm
by XionicFire
yep, atm to remove the padding i just run it again, but the regex option seems like a good script idea.

Thanks everyone for the solutions, definitely solved the problem