> Home > Scripts > AWK >

Output records from the original file where the first 10 characters match "FRANK GRAY" and columns 30-35 match "ACTIVE"

 

#!/usr/bin/ksh

#

#  AWK script source file

#  Created by:   Jeffery J. Jimes

#  Date:         08/22/2001

#  Name:         match_two_cols.awk

#  Usage:  $ awk -f match_two_cols.awk sourcefile > outfile

#

########################################################

 

{

    if (    substr($0,1,10) == "FRANK GRAY" 

         || substr($0,30,6) == "ACTIVE"

       )
    print $0
}