#!/usr/bin/gawk -f # /* vim: set filetype=awk : */ # -*- awk -*- BEGIN{ } /1 worth/ { # note that we have found a treatment, and process it found1 = 1; for (i=3; i "outPro"; print rec >> "outRec"; if (found1 == 1) { buff2="."; for (k in BestTreat) buff2 = BestTreat[j] " / " buff2 ; print buff2; } }