bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple field sort bug


From: Jane Marie Lin
Subject: Multiple field sort bug
Date: Fri, 01 Apr 2005 16:20:26 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Fedora/1.7.6-1.2.5

Hey there,

I installed several things on my computer, and I just noticed today that my "sort" doesn't work when I want to sort by multiple fields.

Some of the things I installed:
1.  libstdc++-devel
2.  several perl packages (Math::Matrix, Math::Combinatorics, Math::BigInts)
3.  gregmisc (R module)

I know "sort" is incorrect on my computer because I used sort on a different computer and it works the way it is supposed to.

Do you know if there is any depencies with sort that might have gone wrong when I installed things?


I wanted to sort alphabetically by the second field first, and then numerically by the last (sixth) field

Input file "tmp" :
NM_024796 chr1 801449 802749 - 802749
NM_145291 chr4 4356519 4388051 + 4356519
NM_153254 chr1 1021134 1027299 + 10211
NM_004195 chr1 1044946 1048147 - 1048147
NM_148901 chr1 1044946 1048147 - 1048147
NM_148902 chr1 1044946 1048147 - 1048147
NM_003327 chr1 1052764 1055570 - 10555
NM_016176 chr1 1058346 1073439 - 107343
NM_016547 chr1 1058369 1073469 - 1073469
NM_016453 chr3 48671313 48683370 - 48683370
NM_030649 chr1 1135001 1144698 - 1144698
NM_153339 chr1 1150051 1153114 + 1150051
NM_015874 chr4 26073330 26184161 + 260
NM_201402 chr4 9101501 9103094 + 9101501
NM_201402 chr4 9106246 9107839 + 9106246
NM_005398 chr10 9305 9305 - 9305
NM_198514 chr10 115279006 115333039 + 115279006
NM_001881 chr10 35419806 35472780 + 35419806
NM_182850 chr10 35419806 35505891 + 35419806
NM_001012752 chr10 27039532 27153965 - 271539


command:  sort -k2b,2b -k6bn,6bn tmp

output:
NM_198514 chr10 115279006 115333039 + 115279006
NM_001012752 chr10 27039532 27153965 - 271539
NM_001881 chr10 35419806 35472780 + 35419806
NM_182850 chr10 35419806 35505891 + 35419806
NM_005398 chr10 9305 9305 - 9305
NM_153254 chr1 1021134 1027299 + 10211
NM_004195 chr1 1044946 1048147 - 1048147
NM_148901 chr1 1044946 1048147 - 1048147
NM_148902 chr1 1044946 1048147 - 1048147
NM_003327 chr1 1052764 1055570 - 10555
NM_016176 chr1 1058346 1073439 - 107343
NM_016547 chr1 1058369 1073469 - 1073469
NM_030649 chr1 1135001 1144698 - 1144698
NM_153339 chr1 1150051 1153114 + 1150051
NM_024796 chr1 801449 802749 - 802749
NM_016453 chr3 48671313 48683370 - 48683370
NM_015874 chr4 26073330 26184161 + 260
NM_145291 chr4 4356519 4388051 + 4356519
NM_201402 chr4 9101501 9103094 + 9101501
NM_201402 chr4 9106246 9107839 + 9106246

Notice the sort performs correctly for all chr____'s but not for chr10


-jane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]