On Friday, April 3, 2020 at 3:07:14 PM UTC-4, Rob wrote:
>
> This is not a Leo problem. However, there a lot of very smart people here 
> who might have some insights into this.
>
> I want to name files in an intuitive way so that Windows (and other apps 
> like Adobe Lightroom) sort them properly. Consider these image file names:
>
> 1990 0909 image1.jpg (0909 indicates September 9)
> 1990 1001 image2.jpg
> 1990 10xx image3.jpg (10xx indicates October with unknown date)
>
> Within Leo, these sort as expected (as above). However, in Windows they 
> sort this way:
>
> 1990 10xx ...
> 1990 0901 ...
> 1990 0909 ...
>
> This doesn't make any sense! How does 1990 10xx ... have a lower numeric 
> value than 1990 0901 ...? I found this reference on Microsoft's page 
> <https://support.microsoft.com/en-us/help/319827/the-sort-order-for-files-and-folders-whose-names-contain-numerals-is-d>,
>  
> but I don't understand it. Does anyone know why this happens and better 
> yet, how to fix it?
>

It's because 0901 is larger than 10.  The only numerals in "10xx"  are 10.  
According to the link you found, it seems like the OS is sorting on the 
characters that can be considered numeric.  In the older days, the 
filenames were just sorted alphabetically, it seems.  That carries its own 
anomalies.

It looks like it is (or used to be) possible to change a registry entry to 
get the old behavior, but this probably isn't the best idea.  I'd suggest 
putting dashes between the number groups, which will get closer to what you 
probably be willing to live with.  It's what I have done for a long time, 
and I haven't notice my image files coming up in strange orders:

1990-09-01
1990-09-09
1990-10-02
1990-10-30
1990-10-xx
1990-11-01

Using the dashes makes the numerical comparisons to be group-by-group, as 
best as I can see.  The example above sorted the same when I did a numeric 
and an alphabetical sort using EditPlus, so that's good too.

It also means that the file names don't have to be quoted if you type them 
on the command line sometime.


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9644d4d7-3c29-4795-93cf-a5d4455c18cc%40googlegroups.com.

Reply via email to