in reply to split function problem
Here is the output with pasted a few times your test data:cat data-file.txt |sed 's/^Cluster//'|sort -k1 -n|sed 's/^\([0-9]\+\)/ +Cluster\1/' > sorted-data.txt
I hope I have helped.$ cat dd |sed 's/^Cluster//'|sort -k1 -n|sed 's/^\([0-9]\+\)/Cluster\1 +/'| cut -c 1-20 Cluster5 SP_1003(con Cluster5 SP_1003(con Cluster5 SP_1003(con Cluster6 SP_0917(pil Cluster6 SP_0917(pil Cluster6 SP_0917(pil Cluster7 spr_1379(A Cluster7 spr_1379(A Cluster7 spr_1379(A Cluster8 spr_0324(T Cluster8 spr_0324(T Cluster8 spr_0324(T Cluster9 SP_0733(hyp Cluster9 SP_0733(hyp Cluster9 SP_0733(hyp Cluster10 SP_0042(co Cluster10 SP_0042(co Cluster10 SP_0042(co
|
|---|