New Eyes on an awk script

Shawn Tayler stayler
Mon Nov 15 00:56:34 PST 2004


Its not so much that as all the syntax errors awk throws on the "if"
statements.  I've been trying all kinds of iterations and the O'Reilly book
is not any help.

Shawn

On Mon, 15 Nov 2004 00:12:23 -0500 Jean Sagi <jeansagi at uniweb.net.co>
exclaimed:

> ++x ins't inside {} ... would that be?
> 
> Shawn Tayler wrote:
> > 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
> > _______________________________________________
> > Linux-users mailing list
> > Linux-users at linux-sxs.org
> > http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> > 
> > Need to chat further on this subject? Check out #linux-users on
> > irc.linux-sxs.org !
> > 
> 
> _______________________________________________
> Linux-users mailing list
> Linux-users at linux-sxs.org
> http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> 
> Need to chat further on this subject? Check out #linux-users on
> irc.linux-sxs.org !
> 


More information about the Linux-users mailing list