New Eyes on an awk script

Shawn Tayler stayler
Sun Nov 14 14:16:02 PST 2004


Would one of you more knowledgable type show me the stupid mistake I am
making with the following awk script?  I have been banging my head against
the "syntax error" wall for a while now.

BEGIN { FS = "," }
++x
if ( NF == 9 )  { print x","$1","$2","$3","$4","$5","$6","$7","$8","$9",NA" } 
if ( NF == 10 ) && ( $9 == $10 ) { print x","$1","$2","$3","$4","$5","$6","$7","$8","$9",NA" } 
if ( NF == 10 ) && ($9 != $10 ) { print x","$1","$2","$3","$4","$5","$6","$7","$8","$9","$10 }
if ( NF == 8 ) { print x","$1","$2","$3","$4","$5","$6","$7","$8", , " }

I keep getting a syntax error on the if statement.

Shawn


More information about the Linux-users mailing list