It's important that you understand what is meant by lexicography sorting alphabetically.
As I mentioned,
m2Name
m22Name
m222Name
Would NOT sort in that order. It would sort as:
m222Name
m22Name
m2Name
Since "2" would sort before "N". The entire string is considered in the sorting, not just the numbers.
I can't help any more than this. The way Rainmeter / FileView sorts is entirely correct using lexicography sorting.
It is currently October 27th, 2024, 3:19 pm
Natural sorting please...
-
- Developer
- Posts: 22891
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
-
- Rainmeter Sage
- Posts: 8576
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Natural sorting please...
It isn't the norm because that's how string are compared in all programs: from left to right, and from the lowest char code to the highest. Whatever programs that seem to do otherwise, e.g. Windows Explorer, they don't: they actually space pad numbers internally. So, the only question here really is... who should do the padding needed for the desired order, the users or the devs.
-
- Posts: 1839
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Natural sorting please...
I can see that now, but you confused me the way you first posted.
Alphabetical sorting is machine sorting and perform on a column basis, not numerical linear basis. ie, it doesn't take into account what the following digit is.
Natural sorting does. Hence why I posted asking for that. Your original reply caused the confusion!
Ok, so now we're both clear...
Is there a way to have Natural sorting without zero padding? It's really annoying and awkward trying to find stuff as my pics show.
Alphabetical sorting is machine sorting and perform on a column basis, not numerical linear basis. ie, it doesn't take into account what the following digit is.
Natural sorting does. Hence why I posted asking for that. Your original reply caused the confusion!
Ok, so now we're both clear...
Is there a way to have Natural sorting without zero padding? It's really annoying and awkward trying to find stuff as my pics show.
57686174 77696C6C 6265 77696C6C 6265
-
- Posts: 1839
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Natural sorting please...
Well, that was what I was requesting, that it be done internally, and it turned into a big debate!Yincognito wrote: ↑September 22nd, 2024, 2:57 pm It isn't the norm because that's how string are compared in all programs: from left to right, and from the lowest char code to the highest. Whatever programs that seem to do otherwise, e.g. Windows Explorer, they don't: they actually space pad numbers internally. So, the only question here really is... who should do the padding needed for the desired order, the users or the devs.
Seriously though, Can we please have the option in the Rainmeter settings for this? Low priority or not, it would be nice for it to be a consideration and eventually added.
57686174 77696C6C 6265 77696C6C 6265
-
- Developer
- Posts: 22891
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Natural sorting please...
Implementing true "nature sorting" is not trivial. There are some libraries out there that deal with the complexities of stuff like "case", "non-ascii characters", and all that, but I'm not sure how easy it would be to shoehorn that into Rainmeter and FileView, and if there would be "backwards compatibility" issues to consider.
Again, I just don't see this as a high priority. Zero-padding numbers in strings is cumbersome, but works.
Again, I just don't see this as a high priority. Zero-padding numbers in strings is cumbersome, but works.
-
- Rainmeter Sage
- Posts: 2752
- Joined: March 23rd, 2015, 5:26 pm
Re: Natural sorting please...
You kids today...
This is why the only proper character set is the ASCII character set, and the only proper sort order is ASCII order.
/jk
This is why the only proper character set is the ASCII character set, and the only proper sort order is ASCII order.
/jk
-
- Developer
- Posts: 22891
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Natural sorting please...
Yeah, but even ASCII has some issues with Natural Sorting:SilverAzide wrote: ↑September 22nd, 2024, 3:06 pm You kids today...
This is why the only proper character set is the ASCII character set, and the only proper sort order is ASCII order.
/jk
a
B
A
b
Would sort as:
A
B
a
b
Since "case" is considered in sorting algorithms.
Notepad++ has gone to great lengths to deal with this:
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 2752
- Joined: March 23rd, 2015, 5:26 pm
Re: Natural sorting please...
That's not really a "problem", per se, that's the "correct way".
This is why we need to go back to uppercase 8.3 filenames.
/jk (again)
-
- Rainmeter Sage
- Posts: 8576
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Natural sorting please...
By the way, I personally ALWAYS name my numbered files by zero padding, since Total Commander (the file manager I use) uses the same lexicographic order. The nice thing is that it has multiple / mass renaming, so if not zero padded already, it can be done in like one or two second or such, for as many files as needed.
So, you see, it's not only a Rainmeter thing. If it was trivial, all programs would do it. When the number is at the start or end of the string it very slightly becomes easier, but one would still need a proper solid algorithm to do it.
So, you see, it's not only a Rainmeter thing. If it was trivial, all programs would do it. When the number is at the start or end of the string it very slightly becomes easier, but one would still need a proper solid algorithm to do it.
-
- Developer
- Posts: 22891
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Natural sorting please...
RAINME~1SilverAzide wrote: ↑September 22nd, 2024, 3:15 pm That's not really a "problem", per se, that's the "correct way".
This is why we need to go back to uppercase 8.3 filenames.
/jk (again)