Page 1 of 1

Sort Month and Year

Posted: 21 Sep 2016 00:02
by Turion
I have some folders named with the months of the year like

Code: Select all

April
August
December
February
January
July
June
March
May
November
October
September
What's the easiest way to sort these folders in the natural month order like this?

Code: Select all

January
February
March
April
May
June
July
August
September
October
November
December
Can the sort order be Windows Explorer friendly?

Re: Sort Month and Year

Posted: 21 Sep 2016 00:43
by highend
You could use a custom column to get that kind of sorting

You have to use the custom column to sort the contents then...

The script:

Code: Select all

    $months = "January|February|March|April|May|June|July|August|September|October|November|December";
    $index = gettokenindex(<cc_base>, $months, , "i");
    return ($index) ? $index : 13;
How the setup of the cc looks like:
CC.png
And here is how it would look like:
CC in action.png

Re: Sort Month and Year

Posted: 21 Sep 2016 14:04
by admin
Or you run this through the Address Bar:

Code: Select all

SortByList "January|February|March|April|May|June|July|August|September|October|November|December", "|";
(No, it's not Explorer friendly. Explorer cannot do this.)

Re: Sort Month and Year

Posted: 21 Sep 2016 16:54
by RalphM
Probably the easiest way that doesn't need any special handling afterwards would be to rename the folders to:
01_January
02_February
...
If you can live with the imperfection but simplicity of this approach.

Re: Sort Month and Year

Posted: 21 Sep 2016 18:44
by admin
... using this Batch Rename pattern after the list is sorted as wished:

Code: Select all

<#01>_*

Re: Sort Month and Year

Posted: 21 Sep 2016 21:39
by Turion
@highend
Thanks for the illustrated solution! :tup:

@admin
Thanks! That's an awesome script! :appl:

@RalphM
Yeah, I was thinking the same thing. Thanks! :tup: