Description: In the screenshot you can see how konqueror sorts files (very annoying).
If for example I have the files file1, file2, file9 and file10 konqueror will sort them this way: file1, file10, file2, file9 instead of file10 being the last one.
I think konqueror needs natural like sorting.
Maybe some people (don't know why they would) need the "computer-like" sorting, so "natural sorting" should be as an option (and turned on by default).
UPDATE: you can vote for this bug here: http://bugs.kde.org/show_bug.cgi?id=87286
According the to page posted by the above poster, ls -sort=version will do this correctly already. What library function does konquorer use to sort? Would it be possible to use ls?
I think this would be a nice feature, I'd like it to be configurable
The link below could help to have an idea on the algorithm to use:
http://sourcefrog.net/projects/natsort/
I think this would be a nice feature, I'd like it to be configurable
The link below could help to have an idea on the algorithm to use:
http://sourcefrog.net/projects/natsort/
Another file sorting problem is that punctuation terms aren't taken into account when sorting file names.
Have a file called "abc123" or "__abc123", that won't make a difference. Same with [abc123]. Or !abc123.
I feel the windows way of doing this (punctuation terms are placed before letters or numbers) should be imported into linux sorting -- at rare times, windows makes things better ;)
I wish such rules for files sorting could be configurable.
This is not really the place to come with bug reports, bugs.kde.org is. This has also already been filed at http://bugs.kde.org/show_bug.cgi?id=87286 so you may vote for it there.
It's possible to implement by treating every numeral sequence as one "token", and sort these numerically. For example, "bk12vol20" would be broken into 'b' 'k' '12' 'v' 'o' 'l' '20', and would come before "bk3v33" as 'b' 'k' '3' 'v' 'o' 'l' '33'.
But I'm not sure if this has general enough use to be implemented. After all, "numbered" file names are only a minority, and among those, not all of them are supposed to be sorted. Also, many people already name files with padded zeroes so that they will be sorted correctly without special treatment.
After all, "numbered" file names are only a minority
Not really. Think about photos. I often make photo galleries for other people: I get photos named with numbers, without leading zeros cause they use another OS (yes windows has this easy mass rename thingy), which sorts files the natural way. So when I copy those files to my computer they get messed up...
Also, many people already name files with padded zeroes so that they will be sorted correctly without special treatment.
read my answer to Rede
I'd rather have it organize all files alphabetically. Besides, I don't think its worth it to alter the current system since you could just name the files file01 file02 ... file 10 and it would display correctly.
Imagine having 98 files, named like you said: file01, ..., file98. Then after some time you unexpectly get two more file99 and file100. Now you would have to rename all 99 files and add them another 0 for konqueror to sort them correctly.
Sure it's a good idea, but how should Konqueror know when you are supposed to use the word 123 (in words one two three) and when the number 123 (in words onehundredtwentythree)? By default, computers use words for filenames so this listing-scheme may be unusefull, but it's correct.
Ratings & Comments
19 Comments
can't download download link refers to png file
According the to page posted by the above poster, ls -sort=version will do this correctly already. What library function does konquorer use to sort? Would it be possible to use ls?
I think this would be a nice feature, I'd like it to be configurable The link below could help to have an idea on the algorithm to use: http://sourcefrog.net/projects/natsort/
I think this would be a nice feature, I'd like it to be configurable The link below could help to have an idea on the algorithm to use: http://sourcefrog.net/projects/natsort/
Another file sorting problem is that punctuation terms aren't taken into account when sorting file names. Have a file called "abc123" or "__abc123", that won't make a difference. Same with [abc123]. Or !abc123. I feel the windows way of doing this (punctuation terms are placed before letters or numbers) should be imported into linux sorting -- at rare times, windows makes things better ;) I wish such rules for files sorting could be configurable.
This is not really the place to come with bug reports, bugs.kde.org is. This has also already been filed at http://bugs.kde.org/show_bug.cgi?id=87286 so you may vote for it there.
Tnx I added the link. I was too lazy to check for it :-)
It's possible to implement by treating every numeral sequence as one "token", and sort these numerically. For example, "bk12vol20" would be broken into 'b' 'k' '12' 'v' 'o' 'l' '20', and would come before "bk3v33" as 'b' 'k' '3' 'v' 'o' 'l' '33'. But I'm not sure if this has general enough use to be implemented. After all, "numbered" file names are only a minority, and among those, not all of them are supposed to be sorted. Also, many people already name files with padded zeroes so that they will be sorted correctly without special treatment.
After all, "numbered" file names are only a minority Not really. Think about photos. I often make photo galleries for other people: I get photos named with numbers, without leading zeros cause they use another OS (yes windows has this easy mass rename thingy), which sorts files the natural way. So when I copy those files to my computer they get messed up... Also, many people already name files with padded zeroes so that they will be sorted correctly without special treatment. read my answer to Rede
I'd rather have it organize all files alphabetically. Besides, I don't think its worth it to alter the current system since you could just name the files file01 file02 ... file 10 and it would display correctly.
Imagine having 98 files, named like you said: file01, ..., file98. Then after some time you unexpectly get two more file99 and file100. Now you would have to rename all 99 files and add them another 0 for konqueror to sort them correctly.
for a in 0 1 2 3 4 5 6 7 8 9;do for b in 0 1 2 3 4 5 6 7 8 9;do mv file$a$b file0$a$b;done;done
Three cheers for solutions that noone but geeks can figure out! ;)
Better solution: rename "s/\([0-9][0-9]\)/0$1/" * puts a 0 in front of all two digit numbers in filenames.
what if the files are on a medium where you don't want or can't rename the files? (a cd or remotely mounted dir...)
use KRename (http://kde-apps.org/content/show.php?content=9876)
Sure it's a good idea, but how should Konqueror know when you are supposed to use the word 123 (in words one two three) and when the number 123 (in words onehundredtwentythree)? By default, computers use words for filenames so this listing-scheme may be unusefull, but it's correct.
The very sad thing is that windoze does sort files like i would like konqueror to do.
Yeah, this is an annoyance for me too. It really should be fixed.