Sorting the files list by video length

Advanced Renamer forum
#1 : 29/01-23 00:36
Gustavo Rezende
Gustavo Rezende
Posts: 1
Hello,

I really like the software. It's full of options!
But I was trying to sort the video files by length to rename them from the shortest to the longest, in that order, adding numbers to the filenames (001, 002, 003...) and I didn't find the option in the columns section.

Is there an alternative way to do it?

Thank you!


29/01-23 00:36 - edited 29/01-23 00:45
#2 : 29/01-23 10:15
David Lee
David Lee
Posts: 1125
The elegant solution would be to use a Script method and write a sort routine. However this will involve some complex JavaScript programming and a simpler workaround would be to rename your files by adding the video length to the beginning of each file then, in a second pass, replace this value with an incrementing number, after sorting the list

First pass...
Add: <Video Hour><Video min><Video Sec>
At index: 0

Run the Batch, reloading all your files and sort the List on the filenames.

Second pass...
Replace: ^\d+
With: <Inc Nr:001>
Use regular expressions





29/01-23 10:15 - edited 29/01-23 10:17