Bob Proulx wrote:
If you want sort to sort on individual fields try the -k option.
  (echo 10,1;echo 1,10) | sort -t , -k 1,1n -k 2,2n
  1,10
  10,1

YOU seem to be aware that sort sorts across an entire line unless -k
is given  and you are aware that sort uses locale defined collating
sequence which folds case and ignore punctuation because both of those
are identified in those bugs that you referenced.  But you obviously
thought this was different in some way.  But I fail to see the
difference myself.

Hrm, perhaps I reduced my test case too far in my haste. The following are the lines in a file that suggested there was an issue:

rs1635242,25,0,1,2,2,1,51,5,0.0892857142857143,3.63636585599894e-05,C/T,3229085,chrX
rs165179,17,0,0,3,10,0,34,6,0.15,7.7442164310441e-06,C/T,138965878,chr5

My understanding, from what you are telling me, is that the following should 
work:

$ sort -t , -k 1.3,1.99n <input>
rs1635242,25,0,1,2,2,1,51,5,0.0892857142857143,3.63636585599894e-05,C/T,3229085,chrX
rs165179,17,0,0,3,10,0,34,6,0.15,7.7442164310441e-06,C/T,138965878,chr5

but it doesn't seem to work for me, just spitting back my input. I find it interesting that the following input sorts correctly, where the index is not used in the sort command:

1635242,25,0,1,2,2,1,51,5,0.0892857142857143,3.63636585599894e-05,C/T,3229085,chrX
165179,17,0,0,3,10,0,34,6,0.15,7.7442164310441e-06,C/T,138965878,chr5

the sort command in this case being:

$ sort -t , -k 1,1n <input>
165179,17,0,0,3,10,0,34,6,0.15,7.7442164310441e-06,C/T,138965878,chr5
1635242,25,0,1,2,2,1,51,5,0.0892857142857143,3.63636585599894e-05,C/T,3229085,chrX

Apologies if this is a different issue. I attempted to reduce my problem, and probably got carried away looking at the locale bugs.

Regards,
David Hall (gringer)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to