List of files with similar names and spaces

Something that has been annoying me for a while is that macOS (and OS X before it) does not ignore spaces in file names or sort them 'naturally'. I'm not sure which version of OS X I first noticed this in, but I think it would have been Yosemite (10.10).


I've included a screenshot of the problem. Essentially the problem is that a file name such as 'Test 2.txt' is sorted before a file name such as 'Test.txt'. macOS sorts spaces first, then numerals, then letters. 'Test1.txt' (no space) sorts fine.


User uploaded file


This is irritating when trying to create human-readable file names, say the Back to the Future trilogy. If the file names match the film titles they would be:


  • Back to the Future.mp4
  • Back to the Future Part II.mp4
  • Back to the Future Part III.mp4


macOS sorts this instead as:


  • Back to the Future Part II.mp4
  • Back to the Future Part III.mp4
  • Back to the Future.mp4


Is there any way to change this so that files sort 'correctly'?

MacBook Pro (Retina, 13-inch, Mid 2014), macOS Sierra (10.12.1)

Posted on Dec 15, 2016 4:53 PM

Reply
6 replies

Dec 16, 2016 5:38 AM in response to experimenthouse

When you have multiple, similar filenames, as you do with the Back to the Future series, you can preface each filename with "1_, 2_, 3_, etc.) to force a numeric order sort. The Finder will automatically accommodate you with the following:

User uploaded file


In the ASCII collating sequence, spaces always take precedence over letters and numbers, which occur later in the character sequence, and without the above structured adaptation, cause you sorting challenges.


I use the above approach, and also keep movie series in their own folder (e.g. Back_to_the_Future).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

List of files with similar names and spaces

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.