#!/usr/bin/gawk -f # /* vim: set filetype=awk : */ # -*- awk -*- BEGIN { Buffd=""; Buffe=""; Buffr=""; DDest=Dest "/defects.dat"; EDest=Dest "/effort.dat"; RDest=Dest "/risk.dat"; FS=","; } /defects/ { Buffd=Pass "\t" $4 "\t" $6; buffdf=""; while ((getline f < DDest)>0) { buffdf=buffdf "\n" f; } if (Pass !~ /1/) Buffd=buffdf "\n" Buffd; } /effort/ { Buffe=Pass "\t" $4 "\t" $6; buffef=""; while ((getline f < EDest)>0) { buffef=buffef "\n" f; } if (Pass !~ /1/) Buffe=buffef "\n" Buffe; } /risk/ { Buffr=Pass "\t" $4 "\t" $6; buffrf=""; while ((getline f < RDest)>0) { buffrf=buffrf "\n" f; } if (Pass !~ /1/) Buffr=buffrf "\n" Buffr; } END { print Buffd > DDest; print Buffe > EDest; print Buffr > RDest; }