BEGIN{ OFS="\t"; } { nhsp[$9]++; hsp[$9,nhsp[$9]]=$0; } END{ for (i in nhsp) if (nhsp[i]>1) for (j=1;j<=nhsp[i];j++) print hsp[i,j]; }