question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sort files and folders by natural order ("100" follows "2")

See original GitHub issue

Add option to sort folders alphabetically

Behavior

Expected order

1-foo
20-bar
110-baz

Actual order

1-foo
110-baz
20-bar

Example

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

10reactions
sindresorhuscommented, Apr 6, 2020

They are already sorted alphabetically, what you’re requesting is called natural sorting.

Don’t forget to also send a feature request to GitHub as it would be better if they fixed this natively: https://github.com/contact

2reactions
AayushSameerShahcommented, Aug 12, 2022

Ahh, any update or a hack on this issue? I really am managing the files in the order, but after reaching at 9 the 10th file is moved to second position. Any help would be beneficial 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sort files and folders by natural order ("100" follows "2") #2977
They are already sorted alphabetically, what you're requesting is called natural sorting. Don't forget to also send a feature request to GitHub ...
Read more >
C# Sort files by natural number ordering in the name?
I know this might be late, but here is another solution which works perfectly FileInfo[] files = di.GetFiles().OrderBy(file => Regex.
Read more >
Why Numeric File Names are Sorted Differently
File names are stored as strings in almost every operating system and database management system. While this works well in most cases, it...
Read more >
How to sort file when reading them with dir ? - MATLAB Answers
Convert each filename to the corresponding number (strip leading doc_ and trailing .txt, then use double); next, sort the numbers and get the...
Read more >
ls - List files sorted numerically - Unix & Linux Stack Exchange
-V, --version-sort natural sort of (version) numbers within text ... upper- and lowercase together, and properly handles directories intermixed with files:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found