"David Hall (coding)" <[EMAIL PROTECTED]> wrote: > 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.
Thanks for the report. What does this print for you? $ printf 'rs1635242,25\nrs165179,17\n'|sort -t, -k1.3,1.99n Here's what I get: rs165179,17 rs1635242,25 And these? sort --version locale -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]