Konqueror "natural" file sorting (idea)

KDE 1.-4. Improvements

Source (required if based on other people's work):

0
Score 79%
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

s4ncho

11 years ago

can't download
download link refers to png file

Report

premierSullivan

11 years ago

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?

Report

kammine

12 years ago

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/

Report

kammine

12 years ago

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/

Report

sabin

12 years ago

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.

Report

bsander

12 years ago

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.

Report

C

lenooh

12 years ago

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

Report

hagabaka

12 years ago

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.

Report

C

lenooh

12 years ago

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

Report

Rede

12 years ago

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.

Report

C

lenooh

12 years ago

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.

Report

per

12 years ago

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

Report

MOD

leinir

12 years ago

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

Report

striderstrahan

12 years ago

Better solution:

rename "s/\([0-9][0-9]\)/0$1/" *

puts a 0 in front of all two digit numbers in filenames.

Report

C

lenooh

12 years ago

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

Report

CaCO3

12 years ago

use KRename (http://kde-apps.org/content/show.php?content=9876)

Report

nightwing

12 years ago

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.

Report

C

lenooh

12 years ago

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

Report

DaBlade

12 years ago

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

Report

product-maker 50 209

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
updated Jun 11 2006
added Jun 10 2006
downloads today
0
page views today 0