Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/awk -f
- # chmod +x this_script.awk
- # ./this_script.awk test1.txt test2.txt test3.txt
- # note: please check data's line terminator(RS). "\r\n" or "\n"
- BEGIN{IGNORECASE = 1;RS="\r\n"}
- $3~/geno/{print$4,"",$5,"",$6,"","P","P";next}
- $3~/counts/{print$4,"",$5,"",$6;print"";next}
- $3~/mean/{a[0]=$4;a[2]=$5;a[4]=$6;next}
- $3~/sd/{a[1]=$4;a[3]=$5;a[i=5]=$6;next}
- /^#/||!NF||/^chr/||$3~/freq/{next}
- {a[++i]=$NF;next}
- END{for(j=0;j<=i;++j){if(j!=0){printf OFS}printf a[j]}print""}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement