Mercurial > repos > dereeper > sniplay
comparison hapmap2mlmm/transpose.awk @ 1:420b57c3c185 draft
Uploaded
author | dereeper |
---|---|
date | Fri, 10 Jul 2015 04:39:30 -0400 |
parents | |
children | c6640c49fd01 |
comparison
equal
deleted
inserted
replaced
0:3e19d0dfcf3e | 1:420b57c3c185 |
---|---|
1 #!/usr/bin/gawk -f | |
2 | |
3 BEGIN { | |
4 max_x =0; | |
5 max_y =0; | |
6 } | |
7 | |
8 { | |
9 max_y++; | |
10 for( i=1; i<=NF; i++ ) | |
11 { | |
12 if (i>max_x) max_x=i; | |
13 A[i,max_y] = $i; | |
14 } | |
15 } | |
16 | |
17 END { | |
18 for ( x=1; x<=max_x; x++ ) | |
19 { | |
20 for ( y=1; y<=max_y; y++ ) | |
21 { | |
22 if ( (x,y) in A ) printf "%s",A[x,y]; | |
23 if ( y!=max_y ) printf " "; | |
24 } | |
25 printf "\n"; | |
26 } | |
27 } |