Konqueror "natural" file sorting (idea)

Various KDE 1.-4. Improvements

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Available as/for:
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

Ratings & Comments

19 Comments

s4ncho

can't download download link refers to png file

premierSullivan

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?

kammine

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/

kammine

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/

sabin

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.

bsander

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.

lenooh

Tnx I added the link. I was too lazy to check for it :-)

hagabaka

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.

lenooh

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

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.

lenooh

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.

per

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

leinir

Three cheers for solutions that noone but geeks can figure out! ;)

striderstrahan

Better solution: rename "s/\([0-9][0-9]\)/0$1/" * puts a 0 in front of all two digit numbers in filenames.

lenooh

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...)

CaCO3
nightwing

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.

lenooh

The very sad thing is that windoze does sort files like i would like konqueror to do.

DaBlade

Yeah, this is an annoyance for me too. It really should be fixed.

Pling
0 Affiliates
Details
license
version
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

Other Various KDE 1.-4. Improvements:

Slicker Debian Package for Woody
cirrusgr
last update date: 22 years ago

Score 5.0

Konqueror/kdesktop suggestion
PovMan
last update date: 22 years ago

Score 5.0

Biiig buttons
dbojan
last update date: 20 years ago

Score 5.0

Yet Another KControl
Frans
last update date: 21 years ago

Score 5.0

Next window and next/previos window
dbojan
last update date: 20 years ago

Score 5.0

Fantasie Toolbar
katoe
last update date: 20 years ago

Score 5.0