Filename work-around for literal sorting?

A swapping-ground for Regular Expression syntax

Filename work-around for literal sorting?

Postby ethanchal » Sat Aug 31, 2019 6:47 pm

Hi there,

I'm trying to rename a few hundred photos to display in a certain order on my TV. However, the TV sorts the photos literally (1,10,100,101,2,20,21,22....) rather than logically (1,2,3...) when using a numeric counter element in the filename.

Is there a way to overcome this and rename all the photos at once? I'm thinking of an expression that does this something like this:

Photo 1 -> aaa, Photo 2 -> aab, Photo 3 -> aac??

Any help appreciated! Cheers!
Posts: 1
Joined: Sat Aug 31, 2019 6:37 pm

Re: Filename work-around for literal sorting?

Postby Jazzfan » Sat Oct 19, 2019 6:39 am

You might've figured this out already, but the key here is to "pad" the numbering system with zeroes.

If the last file name is the 999th in a series then you want to have Numbering selected as Suffix, and padding set at 2 (2 zeroes before single digit counts, 1 before 2 digit counts, etc) 001, 011, 097, 100, 997). I have not reached a 4 digit item count yet so i don't know what happens at that point..

And Select [b]Remove[/] selected and have the first character to the Nth character chosen. This will delete the current filename to set them as just numbers.

Of course that is what I do, someone better versed at this might have a better explanation.

Re: Filename work-around for literal sorting?

Postby therube » Mon Oct 21, 2019 9:38 am

Posts: 889
Joined: Mon Jan 18, 2016 6:23 pm

Return to Regular Expressions