What character to use to put an item at the end of an alphabetic list?
WindowsLinuxFilesystemsAlphabetical SortWindows Problem Overview
I often prepend '_____' to the item I want in first position.
Is there some sort of magical character I could use to put an item at the end of the list?
Something more elegant than "z_item".
Example of this issue for a list of files in Windows Explorer :
Another example from Outlook 2010
Actual folder structure :
- _custom folder1
- _custom folder2
- Inbox
- Sent box
- Spam folder
Expected folder structure :
- Inbox
- Sent box
- Spam folder
- [?]custom folder1
- [?]custom folder2
What caracter could I use?
Windows Solutions
Solution 1 - Windows
I found this thread while wanting folders that sort after Z in Finder on Mac OSX. After several false paths and trial and error, here's what I found:
Characters that sort after Z in Finder (in sort-order)
- z Lower case Z
- ι Greek letter
- Ι Greek letter, capital version of above character, not an "I")
- Ω Omega
- 一 Japanese Character? (Thanks, Jam)
- 口 Japanese character? (Thanks, Jam)
- 末 Japanese character "End" (Thanks, Jam)
- (a private use character) (Thanks, Peter O.)
These are characters others here and in other places on the web, mentioned sort after Z, but that I found DO NOT sort at the end, at least when sorting by name in Finder on Mac:
† ∆ ~ - ſ [ ø ■ |
Solution 2 - Windows
The Special lead-in Character that will put your folder at the end of the list without having to resort to using the "z" combo: U+E83A: Private Use. In fact, I believe any of the Private Use characters will work. () Just copy and paste the character between the brackets.
Solution 3 - Windows
Don't mess up things using strange characters!
I would not suggest using Private Use characters or non-printable characters because they can really mess up the things when you access your folder from terminal or programming languages. I had annoying issues using 末 or other special characters. For example, using Python 2.7, this is how you will see your folders with the non-printable characters Ω, 末, 口,.
os.listdir(os.getcwd())
Out[2]: ['\xe6\x9c\xab ', '\xe5\x8f\xa3 ', '\xce\xa9 ', '\xee\xa0\xba ']
For someone or something using your folder structure, accessing the folder would be very confusing (and you can see it from the comments like this to the top answer).
> So I created a folder with this at the beginning of the name on my > Sharepoint drive and now it's there and I can't access it or delete > it. :| – Rather Notsay Jun 28 '16 at 21:05
Of course, you can print them, but why make the things so unnecessarily complex? If you want to stay on the safe side, I would suggest using standard characters. Which is the last one depends on your File manager. So here is some code that creates a bunch of folders with all the printables strings in Python so you can test your file manager.
import os
import string
for i in string.printable:
try:
os.mkdir(i)
except OSError:
print('OSError for %s' %(I))
Once you have sorted by name you can get your answer.
For Windows 10 - Explorer
using standard characters after z
up to my knowledge there is only zz
and so on.
So using zzNameOfTheFolder
is an easy and safe way to do to that. So even if it's not nice I would recommend it.
For Mac OS X El Capitan - Finder
The z is the last character but note that there is no distinction between capital letters so a folder named zz
can't be stored in the same directory of a folder ZZ
For Ubuntu 16.04 - Nautilus
The hashtag #
is the last character. But if you want some more compatibility with other file managers I would use ZZ
.
Something more elegant than "z_item"?
I guess this depends on your own concept of elegance and I think StackOverflow should diffuse best and safest practices, not the most elegant. However, in many cases, symmetry can help. What about these safe perhaps more elegant solutions:
ZZFoldernameZZ
Zz-Folder name-zZ
zZ-Folder name-Zz
zZFolderNameZz
zzFoldernamezz
Solution 4 - Windows
Despite being years later I wanted to contribute as none of the previously provided answers worked for me. For reference I'm running win7 ultimate SP1.
The solution I landed on resulted from noticing that any files I made for use with Japanese speaking contacts ended at the end of the file list. Apparently Japanese characters don't count as non-alphanumeric similar to hashmark, hyphen, underscore (which place files at the beginning of the list), but also come after English characters.
For my own use I ended up using the 末 character, which roughly means "end" so it makes sense to Japanese readers and is still different enough from English to not become confusing.
Alternatively I would use 口 or 一 for something more stylistically apparent. It's also worth noting that the shorthand "maru" character ○ does not work and sorts along with other non-alphabet characters at the head of the list.
Solution 5 - Windows
I've found two characters that will put your folders at the bottom of the list. The first is "ι" and its variant "Ι". Also, the two best characters to put your folders at the front of the pack are either the No-break space " " and the bullet "·"
For the novice user (like me) who might have found this question and these answers by accident, here's a simple explanation of how to type these characters. The first is literally a space created by holding the "Alt" key & typing "0160" on your number pad and the second is the "Alt & 250" combination (Note: A 10-key number pad is best. If you don't have one on your keyboard, see if you can figure out how to use the alternate number keypad. This is almost always different than the 1-0 keys at the top of your keyboard. Look for tiny numbers printed on the edges of your keyboard -usually the "M" "J" L" "I" "O" "P" & 7-0 keys). Or, of course, you can copy and paste the characters in the quotations above (not as easy if you frequently use them as I do).
Here's a short list of special characters to both prioritize your folders or have them appear at the end of a folder list as well as some other folder-friendly characters. Enjoy (~Peter II)
Useful Characters for Windows Explorer
0160 No-Break Space
· 249/0183 Middle Dot
· 250/8729 Bullet operator
◦ 9702 White bullet
› 0155/8250 (See Above)
∕ 8275 Division slash
ι (End Character)
Ι (End Character)
✓ 2713? Check Mark
׃ Last but not least, this alt key (1475) is Hebrew Punctuation Sof Pasuq -This is a great character to use when you can be used in place of a colon)
Solution 6 - Windows
no one mentioned ٴ
. This is an Arabic character and sorts below z
. Because it's very small, it doesn't annoy.
Solution 7 - Windows
Most answers here suggest a non-standard character, which will sooner or later cause issues with various systems.
One answer here, which in my opinion is the best, out of all existing to the moment, is to use the last standard character available on your system. For most of us, that's just z
. This solution is already suggested by the question and it is indeed not very elegant.
My elegant solution is to use a thesaurus to come up with alternative folder names that sort accordingly. Want your Archives
folder to be last, rather than first, maybe Museum
will do it, or perhaps Smithsonian
, otherwise Zipped
works for sure.
Of course, this solution involves a bit of extra work, but it is elegant, it expands your vocabulary, and it might bring you a bit of joy in your work.
Solution 8 - Windows
Another approach is to use a right to left character, for example an Aramaic letter, so that the sorting character appears at the end rather than the front. For example, I've chosen Zayin https://graphemica.com/𐡆;
So, typing in:
ࡆ Alpha
is rendered by the text engine as:
Alpha ࡆ
With the word now sorted below a folder named 'z'.
The full unicode details are:
𐡆
IMPERIAL ARAMAIC LETTER ZAYIN
Unicode: U+10846, UTF-8: F0 90 A1 86
Note: I've tested this on MacOS, not every text renderer correctly handles right to left languages.
Solution 9 - Windows
Using cp1252 and unless you're using the letters ø ù ú û ü ý þ ÿ alot, ÷ seems to be an option...
Edit: Using unicode, ■ (\uffed) might also be a possibility, unless you are writing a lot in Linear-B...
Solution 10 - Windows
For web and SQL purposes, pre-pending CHAR(127) forces text to the bottom and adds no visible character. Works at least for our use of SQL and the jQuery datatables plugin.
Solution 11 - Windows
If you don't like memorizing special alt codes that you don't regularly use in day-to-day typing just remember these three rules:
- The exclamation point
!
is the first character on a US keyboard UPPERCASE
letters come beforelowercase
letters- The tilde
~
character is the last character on a US keyboard
You can easily navigate these rules in any terminal, but you may need to type \!
or \~
(depending on your shell).
Example Listing (e.g. tree -aL 1
):
.
├── !first
├── .hidden
├── UPPER
├── lower
└── ~last
And if you don't like those characters, for whatever reason, here they all are in sorted order:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Solution 12 - Windows
I use:
_ (underscore) to sort before the alphabet and
- (hyphen) to sort after the alphabet.
(Works with czech sorting in Windows explorer and Total commander.)
edit: Windows 7 and later sort the hyphen - as if the hyphen wasn't there.
Solution 13 - Windows
Those that find that most of the codes given here produce different characters than what is described, you probably have EnableHexNumpad enabled in HKCU \ Control Panel \ Input Method... this is by and large a good thing, but you do have to convert the codes to hex and precede them with '+' sign (on the num keypad), eg. for the colon at Alt+1475, use the hex equivalent of Alt+5C3 ( hit Alt with the left hand and hold it down, then with the right hand hit the keypad + … then 5 , C , and 3 … then let go of Alt ).
And, speaking of colons, there's another (smaller) good colon at Alt+1361 hex, which would be Alt+4961 without HexNumpad if it works that way.