Hi,
I did not understand how it differs.
$ cat sample |
*sml_0018 *smmt_0031 sdmt_0042 *srmt_0053 |
1 1 1 1 |
11.2902 12.4807 10.7395 7.9672 |
8.98292 9.03125 9.69812 7.7105 |
7.71334 8.28308 8.05211 7.57295 |
9.07925 9.17628 8.96038 8.1141 |
10.1289 8.9778 9.17119 7.52616 |
11.5821 9.54838 8.76748 8.19344 |
9.18122 9.71467 10.1511 13.4099 |
$ awk '{for (i=1;i<=NF;i++) {if (NR==1 && $i~/^*/) A[i]; if (i in A) printf $i"\t"} print ""}' sample
*sml_0018 *smmt_0031 sdmt_0042 *srmt_0053
1 1 1 1
11.2902 12.4807 10.7395 7.9672
8.98292 9.03125 9.69812 7.7105
7.71334 8.28308 8.05211 7.57295
9.07925 9.17628 8.96038 8.1141
10.1289 8.9778 9.17119 7.52616
11.5821 9.54838 8.76748 8.19344
9.18122 9.71467 10.1511 13.4099