grossham

Q: Finder file sorting preferences - Finder ignores zero in filename

My issue, Finder and Matlab sort differently for files that have text and numbers in the name. Essentually I am viewing the Matlab output values side-by-side with the filenames from finder. Manual fixing this issue is NOT feasible given the volume of files I have (thousands).

 

Does anyone know how to change the default sort options so that Finder doesn't ignore them?!?!

Matlab Sort Order (and Desired Format)

Name03.dat

Name1.dat

Name2.dat

Name4.dat

Name8.dat

 

Finder Sort Order (Um... why?)

Name1.dat

Name2.dat

Name03.dat

Name4.dat

Name8.dat

 

(Please no general matlab advise)

OS X Mavericks (10.9.2)

Posted on May 4, 2014 7:52 PM

Close

Q: Finder file sorting preferences - Finder ignores zero in filename

  • All replies
  • Helpful answers

  • by Barney-15E,

    Barney-15E Barney-15E May 5, 2014 6:12 AM in response to grossham
    Level 8 (49,722 points)
    Mac OS X
    May 5, 2014 6:12 AM in response to grossham

    Finder has always sorted file names as they should appear. There is no need for leading zeros.

    Since 3, 03, 0000000000003 is just 3, it sorts the file into where the threes go.

     

    I don't think there is a way to alter the sort algorithm.

  • by grossham,

    grossham grossham May 5, 2014 8:46 AM in response to Barney-15E
    Level 1 (0 points)
    May 5, 2014 8:46 AM in response to Barney-15E

    The zero is not leading, there is text before the numerical charicters. The zero was placed so as not to add a decimal in the filename (Matlab will not understand the file extension).

  • by Barney-15E,

    Barney-15E Barney-15E May 5, 2014 5:24 PM in response to grossham
    Level 8 (49,722 points)
    Mac OS X
    May 5, 2014 5:24 PM in response to grossham

    It is leading (or padding if you like) in the numerical portion of the name.

  • by Reinard Schmitz,

    Reinard Schmitz Reinard Schmitz Jul 23, 2016 4:13 AM in response to Barney-15E
    Level 1 (59 points)
    Jul 23, 2016 4:13 AM in response to Barney-15E

    In the filename all characters should be characters, not numbers. Otherwise you get scrambled your file lists:

     

    https://www.dropbox.com/s/8ypgudfumvayl1j/Bildschirmfoto%20von%20Finder%20%2823- 07-16%2C%2013-45-08%29.png?dl=0

  • by Barney-15E,

    Barney-15E Barney-15E Jul 23, 2016 4:37 AM in response to Reinard Schmitz
    Level 8 (49,722 points)
    Mac OS X
    Jul 23, 2016 4:37 AM in response to Reinard Schmitz

    You would have to contact Apple about that.

    Apple's content-based sorting algorithm works tremendously well for me. I don't have to pre-design my numerical suffixes with padding, then rename all files when I failed to recognize the need for another order of magnitude.

    Your screen shot appears to sort the files correctly.

  • by Reinard Schmitz,

    Reinard Schmitz Reinard Schmitz Jul 23, 2016 5:11 AM in response to Barney-15E
    Level 1 (59 points)
    Jul 23, 2016 5:11 AM in response to Barney-15E

    I started working with computers in 1970 (hardware construction and OS and Application programming) an did and do it all my life until now. Never i found an explanation like that. Most Applications in this world will fail to find a file with this logic. Its a bug. nothing more and nothing less. If it works for you thats ok., but it is a bug. For my work its a horror.

     

    And my screenshot shows that it is sorted incorrectly and why I all the day am searching for a solution...

  • by Barney-15E,

    Barney-15E Barney-15E Jul 23, 2016 5:48 AM in response to Reinard Schmitz
    Level 8 (49,722 points)
    Mac OS X
    Jul 23, 2016 5:48 AM in response to Reinard Schmitz

    It's not a bug. It is designed that way so you don't have to prepend padding characters to sort things numerically. You may not like it, but it has been that way since very early in the Mac OS.

    Numbers in file names are almost exclusively used to add ordinality to the naming convention. Therefore, it makes perfect sense to sort the names based on that ordinal value.

    Most humans don't think in this sense, "I will never need more than 640 files, so I will append two zeros at the front of my numerical suffixes. Oops, I need more than 1000 files, now. Crap..."

    Nobody wants to see,

    PO1

    PO10

    PO100

    PO2

    PO3

    PO11

    PO12

  • by Tom Gewecke,

    Tom Gewecke Tom Gewecke Jul 23, 2016 6:33 AM in response to Reinard Schmitz
    Level 9 (79,035 points)
    Jul 23, 2016 6:33 AM in response to Reinard Schmitz

    Reinard Schmitz wrote:

     

    I started working with computers in 1970 (hardware construction and OS and Application programming) an did and do it all my life until now... For my work its a horror.

     

    Apple has used this system for the last 15 years.  If you want to do it the other way, I think you have to use Terminal or an alternative finder app.

  • by BobHarris,

    BobHarris BobHarris Jul 23, 2016 6:32 AM in response to Reinard Schmitz
    Level 6 (19,272 points)
    Mac OS X
    Jul 23, 2016 6:32 AM in response to Reinard Schmitz

    It is obviously an intentional design feature, not intended for people of our age and up close and personal experience with computers (punched my first 80-Column card around 1970, and have worked for Univac, DEC, Compaq, HP, and other companies big and small).

     

    But Apple does not really target users with our experience.

     

    If you want to tell Apple they are doing it wrong, then here are some links you can use:

    BugReporter (Free ADC (Apple Developer Connection) account needed for BugReporter)

    <http://bugreporter.apple.com>

    Anyone can get a free ADC account at:

    <https://developer.apple.com/register/index.action>

    And/Or Mac OS X Feedback

     

    <http://www.apple.com/feedback/macosx.html>

    Most Applications in this world will fail to find a file with this logic.

    Applications do not generally care about the Finder sort order.  And if they ask the file system for a list of files, they are going to get them in an un-sorted order.  The order returned will more likely be the order the files happened to be stored in the directory, which might be the order in which they were added to the directory, or if a hole from a previous file delete is large enough for the new file name, then inserted in the middle.

  • by Reinard Schmitz,

    Reinard Schmitz Reinard Schmitz Jul 23, 2016 9:30 AM in response to Barney-15E
    Level 1 (59 points)
    Jul 23, 2016 9:30 AM in response to Barney-15E

    You are right. Nobody should see that, but:

     

    P0001

    P0002

    P0021

    P0234

    P9999

     

    So: If you have really 10 thousands of photos with the naming convention Pxxxxx.jpg and by mistake your workflow missed to transform  the filename from the Camera (i.g. P3155.jpg to P03155.jpg) but the last file was P03154.jpg where would you search in a long finder list for the file? In the area of P0... or in that of P3... ?

     

    The Finder sorts P03xxx and P3xxx  to the same place in the list, so I will miss this file when I go to the P3... area.

     

    I use Apple since 2003 and never ran in this problem, it just happened today for the 1st time. And I have to find a solution for this uncertainty.

  • by Barney-15E,

    Barney-15E Barney-15E Jul 23, 2016 9:37 AM in response to Reinard Schmitz
    Level 8 (49,722 points)
    Mac OS X
    Jul 23, 2016 9:37 AM in response to Reinard Schmitz

    I would search in the three thousands as the numeric value 03155 is equivalent to 3155.

    I don't see any uncertainty at all.