#WBL 28 March 2012 $Revision: 1.00 $ #usage: BEGIN { # v = "$Revision: 1.2 $"; # print "#replaced.awk",substr(v,2,length(v)-2),strftime(); for(j=1;j ",ARGV[j]); for(i=length(ARGV[j]);i>0;--i) { printf("%s",complement(substr(ARGV[j],i,1))); } printf("\n"); } } function complement(x) { x=toupper(x); if(x=="A") return "T"; if(x=="C") return "G"; if(x=="G") return "C"; if(x=="T") return "A"; return "n"; }