in reply to sorting a file - multilevel
Yes, the 10th col is UTR but it varies, ti can be GENE, CDS, RNA..
another problem is that I need GENE to always be first (not regular lexicographic sort)
#!/bin/ksh awk 'BEGIN { SORTCD["GENE"] = 1 SORTCD["CDS"] = 2 SORTCD["RNA"] = 3 } { print SORTCD[$3], $0 }' <<EOT | 1 1 RNA 1 1 GENE 1 2 CDS EOT sort -n -k2,3 -k1,1 | sed -e 's/^[0-9]* //' [download]