If I have a file consisting of data that looks as follows, how would I sort the data based on the numbers in the 3rd column ? The space between the first two columns are NOT tab delimited but some number of spaces. The space between the second and third column varies based on the size of the number. Also note that there are spaces within some data of the second column ( like lp25( plasmid between ( and p) while other do not have any spaces( like chromosome). HELIX       lp25(plasmid           24437 bp    RNA     linear       29-AUG-2011HELIX       cp9(plasmid             9586 bp    DNA     helix       29-AUG-2011HELIX       lp28-1(plasmid         25455 bp    DNA     linear       29-AUG-2011HELIX       chromosome            911724 bp    DNA     plasmid       29-AUG-2011
How to sort data by the numbers in third column?
text processing;sort;bioinformatics
Try this:sort -n --k3 <file>For example:$ sort -n -k3 testHELIX       cp9(plasmid             9586 bp    DNA     helix       29-AUG-2011HELIX       lp25(plasmid           24437 bp    RNA     linear       29-AUG-2011HELIX       lp28-1(plasmid         25455 bp    DNA     linear       29-AUG-2011HELIX       chromosome            911724 bp    DNA     plasmid       29-AUG-2011-n sorts by numeric value, and -k3 selects column 3.