#!/usr/bin/gawk -f BEGIN { while(getline x < F) { if((x !~ /Terminated/)&&(x !~ /cost/)) { split(x, lines,","); print lines[32]","lines[33]; } } close(F); }