#1 2025-01-07 08:34

andrea83bg
Member
Registered: 2025-01-07
Posts: 2

Random number but in a sequence

Hi all, happy new year!

I just need a little help to reach this target: i have several files and i would like to generate a random number to be placed as prefix, starting from 1 to, for instance, 200.

So i would like a scenario like that:
FROM:

file.mp3
new_file.mp3
song.mp3
...

TO:

2 - file.mp3
1 - new_file.mp3
3 - song.mp3
...


At this moment with the "serialize" feature, i just succeded in assigning numbers but not in a random sequence.
With the "randomize" feature, i just succeded in assigning random numbers but they are not starting from 1 and they are not in a sequence.
I would need a mix of those functions smile

Any suggestion please?

Have a nice day!
Andrea

Offline

#2 2025-01-07 13:08

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,456

Re: Random number but in a sequence

The simplest way to achieve your goal:

1. Insert a random number prefix.
2. Sort by new name.
3. Remove the random number prefix.
4. Insert an incremental number prefix.
5. Rename.

Basically, you will randomise the order of files with steps 1-3 before adding the final index in step 4.

For a fully automated solution, one could code it up in the Pascal Script rule.

Offline

#3 2025-01-07 13:51

andrea83bg
Member
Registered: 2025-01-07
Posts: 2

Re: Random number but in a sequence

Hi! Thanks a lot for your reply, that's really a good idea and it worked fine! smile

Thanks, I really appreciated your help.

Have a nice day,
Andrea

Offline

Board footer

Powered by FluxBB