BEGIN { new_notes=0; first_line=1; } $0 ~ VERSION { new_notes=1; } { if (first_line) { print "============================================================"; print $0; first_line = 0; } if (new_notes) { print $0; } }