gravatar for mxlsherry1992

2 hours ago by

Dear all, I had a "txt" format file, there are 6 columns in this file, and each column is separated by 'tab'. What I want to do is that I need to sort according to the third column (weight) and make it in descending order.

Here is the script I used: sort -t ' ' -k 3nr file.txt > output.txt

But it failed, because the file is separated by 'tab', not 'space', but sort -t could not recognize 'tab'...

So if you know there is any way I could modify this command...

Thank you!

fromNode    toNode  weight  direction   fromAltName toAltName
gene27800   gene27803   0.242239037515047   undirected  NA  NA
gene14069   gene24274   0.118796442936695   undirected  NA  NA
gene14069   gene27143   0.0263384423340508  undirected  NA  NA
gene14069   gene24130   0.0654074678531233  undirected  NA  NA
gene14069   gene3821    0.0380989989267045  undirected  NA  NA
gene14069   gene6806    0.0928347139289517  undirected  NA  NA
gene24274   gene17058   0.0359478700694831  undirected  NA  NA
gene24274   gene3821    0.0352256086861173  undirected  NA  NA
gene24274   gene6806    0.232437951139367   undirected  NA  NA
gene11428   gene17058   0.0423883022935711  undirected  NA  NA
gene10886   gene10013   0.119643192562815   undirected  NA  NA
gene23678   gene27143   0.150740856709077   undirected  NA  NA
gene23678   gene23683   0.24929646045785    undirected  NA  NA
gene17058   gene3821    0.0368572782031628  undirected  NA  NA
gene17058   gene6075    0.0260725092173397  undirected  NA  NA
gene27143   gene24130   0.0244502519723576  undirected  NA  NA
gene27143   gene23683   0.312512557714924   undirected  NA  NA



Source link