'_' can't be right sorted in Windows
See original GitHub issueIn windows OS, I want to sorted files in a content with a natural way. But I found your code seems to be not well done in windows. The '_'
is sorted after number '0-9'
. But in windows OS, the '_'
is showed before number '0-9'
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:27 (16 by maintainers)
Top Results From Across the Web
My files will not sort alpha-numerically in Windows 10
1. Run gpedit.msc to open the Local Group Policy Editor · 2. Navigate to: Computer Configuration -> Administrative Templates -> Windows ...
Read more >How to Sort and Select Files and Folders Windows 10 [Tutorial]
Right -click in an empty area in the folder and select either the Group by or Sort by option. Wait for the sub-menu...
Read more >Turn off Numerical Sorting in Windows 10 File Explorer
In Windows 10, numerical sorting is enabled by default and file explorer ... Right-click any blank area in the right pane and select...
Read more >Sort and arrange items in the Finder on Mac - Apple Support
Sort and arrange items in the Finder on Mac. There are four ways to view items in a Finder window: as icons, as...
Read more >Cannot permanantly sort items in Windows Explorer
After you get it sorted/arranged the way you want, instead of closing the folder with the red "X" upper right, hold the shift...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK - I have finally decided how I want to implement this.
winsorted
andwinsort_key
into the APIalg
option for customization of the results (though I will still providekey
)It does seem that Microsoft has a custom sorting order for characters (at least for Excel) as can be seen in the table given here. In this table the
_
character appears before numbers, which is not how it appears in the ASCII table. This is why Python’ssorted
(and thusnatsorted
) places the_
character after and not before number characters.Having said this, it’s not clear to me what the request is here. As filed, the issue simply states that
natsort
is “not well done in windows” and points out the behavior ofnatsorted
compared to Windows Explorer. Is thisnatsort
return the same results as Windows Explorer?