#!/bin/nawk -f BEGIN { true = (0 == 0); false = ! true; store = false; } /^The parameters for '/ { game = $4; gsub(/[']/, "", game); next; } /^Status of the/ { if ($7 ~ /Spring/) { season = "spring"; } else { season = "fall"; } year = $9; sub(/[.]/, "",year); store = true; outfile = \ "/home/baldy/jstewart/dip/Intimate/" game "/" year "/" season "/judge.list"; print "The following players are signed up for game" > outfile; next; } (store == true) { print $0 > outfile; }