jeudi 26 février 2015

How to sort by column and break ties randomly


I have a tab-delimited file with three columns like this:



a b 4
c d 1
b c 1
a e 3
d b 0


I want to sort this file (using the sort command in unix) by decreasing values in the third column, but I want to break ties randomly, and not using some other column to do so. Is there a way to do this?



Aucun commentaire:

Enregistrer un commentaire