Sort order of alphanumeric file names in Finder

File Name Sorting
I often using dates for file names - for letters and for photos in particular, with a format something like yymmdd, e.g., today's date, December 27, would be 071227. Occasionally I may use 20071227. If I have the year and month but do not have a specific date, the file name might look like 0712xx. The sort sequence of files in the various Finder views does not seem to be what I would expect, based on standard computer alphanumeric sorting rules. Here is what I am finding - three files beginning with file names 0708xx, 070212 and 070521 will appear in the Finder list as follows:
0708xx
070212
070521
whereas I would expect the proper sort order to be:
070212
070521
0708xx
If I change "xx" to "00" then the sort order is strictly numerical, i.e.,
070212
070521
070800
No one can explain why the files sort per the first list above, if I use the "xx" convention for the date. Is there a Leopard bug, or is the sort order based on an algorithm I am unfamiliar with.

Tom's comprehensive article provides the answer but is perhaps a bit much for those looking for a simple, easy to remember rule. The brief one at File System Overview: Sorting Rules may be useful in this respect:
"Digit sub-strings are sorted by numeric value rather than as characters."
IOW, much like a human would naturally do, the Finder considers numeric expressions as potentially multi-character entities.
Except ... just like humans, it seems not to know what to do with leading zeros. Try this:
Create a new folder & add to it 4 sub-folders named as follows (all "0" characters are zeros):
2
2aa
02
02aa
Note that in list view, Leopard sorts them by name as follows:
02
2
02aa
2aa
But, try selecting them in order by hitting the tab key repeatedly, which should move you down the list one item after the other ... but doesn't.

Similar Messages

  • PhE11: No possibility to sort my pictures by file name !  Why not ?? (Like in PhE 9)  Tha

    There is in PHE 11 Editorno longer a possibility to sort my pictures by file name !  Why not ?? (Like in PhE 9)  That creates a big problem working with my thousands of files !

    dear Brett N
    I am a new macbook user forced to give up Digital Image Pro (winXP), and looking for a photo program that sorts BY NAME. REPEAT BY NAME.
    I was ready to purchase PSE11, but luckily I read this forum and saw that in your infinite wisdom you spared every expense and removed this function.
    I have no need for face recognition, type of photo, etc.
    Should I abandon 15 years of files all sorted by where they were taken?
    I think not. For you to do this to previous owners shows a blatant disregard for them.
    I will look elsewhere and not to a Photoshop product.
    Should you provide an update that corrects this I would consider installing it on my 2 new Apple machines. Hurry though......

  • Can't rename file name under Finder even as an administrator.

    As an adminstrator to my MacBook Pro, why can't I rename certain file name  under Finder?

    Have you tried running lsof from the Terminal?
    Lsof will show you any files that are open, the likelihood is that your file is in use.

  • Can not change file names in finder

    Several times over the past week I have not been able to change existing file names in Finder. The mouse moves normally and can highlight the name, but the keyboard instructions, including "delete" or typing, does not result in any response. All other programs continue to function normally.
    Restarting the computer solved the issue for a while, but it happened again.
    Reading over the previous posts, none of them apply (I do not have those programs).
    Any idea why this happens and how do I fix it?

    This same thing happens occasionally (or maybe rarely is a better word) for different users here at my work.
    I haven't had the problem myself, and thought it was gone now when everyone is running Mac OS 10.4.7 (we ran 10.4.5 just recently) but a user just got the problem 5 minutes ago. All apps except Finder respond to keystrokes.
    Relaunching the Finder using "Force Quit..." from the Apple solves it, but I guess sooner or later the problem will come back.
    Would be great to know what's causing it.

  • TS2512 i m trying to convert dpx files to mov in colour 1.5.3 but in file browser files are not seen in proper order for ex files names are 12345 it is coming as 23145 bcoz of which in output also its coming in wrong order

    i m trying to convert dpx files to mov in colour 1.5.3 but in file browser files are not seen in proper order for ex files names are 12345 it is coming as 23145 bcoz of which in output also its coming in wrong order

    1) What you downloaded should be a packed file (zip, tar.gz, etc) that needs to be unpacked into the directory of your choice.
    2) & 3) are answered by Ant's installation documentation (the page you're quoting from):
    http://ant.apache.org/manual/index.html

  • If I have a pic in more than one album, does iPhoto make more than one copy of that pic?  When I search the file name on finder, it seems to be showing one copy of that file for every album it's in.

    If I have a pic in more than one album, does iPhoto make more than one copy of that pic?  When I search the file name on finder, it seems to be showing one copy of that file for every album it's in.

    No it doesn't. Albums simply reference the photos in the Library. A single shot can be in 100 albus and use no extra disk space at all.
    If you have the same shot in two Events then yes, the file is duplicated.
    When I search the file name on finder, it seems to be showing one copy of that file for every album it's in.
    The Finder doesn't really understand the iPhoto Library. It's quite possible for the iPhoto Library to contain many files with the same name. The Library also contains different versions of the same shot - thumbnail, originals and edited version. This is normal.
    Regards
    TD

  • How Do I Sort Events by Event File Name?

    Hi All,
    Searched the forums extensively and can't seem to find anything on point. I'm trying to sort my events in iMovie appropriately and it's a challenge. Some of my events are recent, imported digital videos. Others are old VHS videos from the 80s and 90s converted through video capture devices. Others are simple videos filmed through my point and shoot camera. Bottom line, they only have a digital tag based on two things: the date they were imported into iMovie (analog stuff brought in through video capture) or actual digital tags from a digital video recorder.
    So they only way to really get these events sorted correctly is to name them in a conventional "year-month-day" naming convention and sort, just like other files.
    My problem is that I can't get iMovie to sort this way even after I successfully rename EVERY event (and there's like 150 events at this point).
    Any ideas? It seems simple. How do I sort events WITHIN the iMovie application by event name?
    Thanks,
    -Ben (San Antonio)

    Did the trick! I'd love it if there were a bit more of an assembly line capability to this, as I needed to change the creation date for 154 clips, which involved attaching, adjusting, removing, attaching, adjusting, removing...
    Lot's of mouse work is all.
    BUT it did the trick!
    Thanks,
    -bh-

  • Sorting string like windows file name sorting

    Hi everybody, I have a simple question.
    I was trying to sort some file name in java
    Let say we have a list of string which are :
    1.txt
    a.txt
    2.txt
    11.txt
    a(1).txt
    a(11).txt
    a(2).txt
    If i convert those strings as file names, and sort it by file name in the windows explorer the result is
    1.txt
    2.txt
    11.txt
    a(1).txt
    a(2).txt
    a(11).txt
    a.txt
    But if i enter those strings into an Arraylist and use Arrays.sort or Collections.sort, the result is
    1.txt
    11.txt
    2.txt
    a(1).txt
    a(11).txt
    a(2).txt
    a.txt
    Is there a way to achieve the string sort similar to windows rather than aplhabetically like the default sort of Arrays/Collection.
    I have done some searching but only found problem regarding to different language character sorting which can be achieved using Collator but this was not my case. Has anybody encounter this issue ?
    Any help is greatly appreciated
    regards
    Hendra Effendi

    ballistic_realm wrote:
    Let say we have a list of string which are :
    1.txt
    a.txt
    2.txt
    11.txt
    a(1).txt
    a(11).txt
    a(2).txt
    If i convert those strings as file names, and sort it by file name in the windows explorer the result is
    1.txt
    2.txt
    11.txt
    a(1).txt
    a(2).txt
    a(11).txt
    a.txt
    ...Not sure, but wouldn't Windows sort it like:
    1.txt
    2.txt
    11.txt
    a.txt
    a(1).txt
    a(2).txt
    a(11).txt
    If so, the try something like this (UNTESTED!):
    class WindowsFileNamesComparator implements Comparator<String> {
        public int compare(String a, String b) {
            String[] tokensA = tokenize(withoutExtension(a));
            String[] tokensB = tokenize(withoutExtension(b));
            int max = Math.min(tokensA.length, tokensB.length);
            for(int i = 0; i < max; i++) {
                if(tokensA.equalsIgnoreCase(tokensB[i]))
    continue;
    else if(tokensA[i].matches("\\d+") && tokensB[i].matches("\\D+"))
    return -1;
    else if(tokensA[i].matches("\\D+") && tokensB[i].matches("\\d+"))
    return 1;
    else if(tokensA[i].matches("\\d+") && tokensB[i].matches("\\d+"))
    return Integer.valueOf(tokensA[i])-Integer.valueOf(tokensB[i]);
    else
    return tokensA[i].compareTo(tokensB[i]);
    return tokensA.length - tokensB.length;
    private String[] tokenize(String s) {
    List<String> tokens = new ArrayList<String>();
    Matcher m = Pattern.compile("\\d+|\\D+").matcher(s);
    while(m.find()) {
    tokens.add(m.group());
    return tokens.toArray(new String[]{});
    private String withoutExtension(String s) {
    int lastDot = s.lastIndexOf('.');
    return lastDot < 0 ? s : s.substring(0, lastDot);

  • Saving internet file now results is meaningless alphanumeric file name instead of doc name

    A few weeks ago reader X suddenly started puting all the tools (like save file) back in the top of the window. They were missing for quite some time and very frustrating. I could find no way to bring them back.  Now, however, whenever I save an internet file, a short meaningless alphanumeric name is inserted rather than using the file name/document name that has always been used before. Is there a way to return this to previous behaviour?

    Hi,
    I'm sorry you are having this problem, here is another post about the same problem, where the cause of the problem is described:
    https://support.mozilla.com/en-US/questions/894442
    A bug has been filed to track resolution of the issue here, because a true fix isn't yet available:
    https://bugzilla.mozilla.org/show_bug.cgi?id=703015
    I apologize for the inconvenience.
    Regards,
    Michelle

  • Export File Names from Finder Window...

    I want to export all the file names in a finder window to a file that I can use in Excel (txt, csv, etc.). Can I do this directly from the finder window somehow?

    The answer just above is excellent.
    One additional point which might assist when importing into a spreadsheet.
    If you use a simple naming convention which I developed about 6 years ago for exactly this purpose, you can sort on various features of documents, etc.
    The name of each file is:
    International date,originator,receiver,subject
    This structure looks like this:
    2008-09-12,dwc,you,naming files for spreadsheet use
    THis allows for automatic date sorting or date structuring of files chronologically
    It allows one to know who or what was the source of the document
    It allows one to know to whom it was sent
    and it allows a brief subject with keywords
    More important, because commas are used to separate the fields, they can
    be used as delimiters when importing the text file into a spreadsheet, thus allowing far greater sorting capabilities.
    Best wishes,

  • How do I change the sort order in the file picker?

    Hi there,
    I've recently hit a problem with the Save and Open dialogs in Mavericks. Some how I have changed the sort order within the Column View so that it sorts by modified date and no longer by name. Unfortunately I can't work out how that happened or how to get it back so that it sorts by Name.
    Please could anyone help?

    Normally, you click on this thing (shown below) and select the sorting preference.

  • Aperture: After changed the file name in Finder Aperture can't load the referenced file anymore

    After I've changed the file name/format in Finder Aperture can't load/relink to the referenced file anymore. For some reasons I don't like to reimport the file.

    As you told, the command "Locate Referenced File" doesn't work, if the filename doen't match exactly. And the filenames should keep their new names.
    "Locate Referenced File" will be able to reconnect one file at a time, if you direct Aperture to the matching file in the Loate Referenced File dialog, but it will not be able to recognise the other matching referenced files and to reconnect them all at once with the "Reconnect All" button.
    It will be a lot of work to reconnect the one by one.  Usually it is much easier to rename the original master files using Metadata > Batch change in Aperture than to try to do that in the Finder.

  • How to remove a file name in Finder window places

    When I open Finder window I want to remove a file name in places. I don't use the file anymore and want to remove it.

    Hold down the command key and drag it out of the sidebar.

  • Blue background behind some file names in finder

    Hello,
    I've been noticing that some of my file names have a blue background behind them, while others don't. It's not an alternating pattern either. It's very random. Most files have the blue background, while some have a while background behind the file name.
    This is happening in Finder, and in all folders.
    Thanks

    Thanks, I'll give that a try.
    I'm wondering though, is there a default setting that is set when the OS is loaded? We just did a re-install of OS 10.4 on the machine, and I'm wondering if there is a setting that needs to be changed for new files that are downloaded from email? I'd just like to get rid of the color altogether.

  • How to see the whole file names in finder column view?

    Hi guys,
    I like to use finder in column view. However, most of the times, the file names get trunked and I have to redim the column to see the whole names. Other day, without wanting to, I must have pressed some key combination, and the column got redim automatically, so I could read the whole file names. So, my question is if does anybody know how to achieve this?

    I don't know what "redim" means, but if you double-click the column separator, it becomes wide enough for the longest name. If you Option-double-click it, all columns become wide enough for the longest name in each column.

Maybe you are looking for