Computing.Net > Forums > Programming > awk syntax error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

awk syntax error

Reply to Message Icon

Name: pratyusha
Date: July 6, 2009 at 13:54:30 Pacific
OS: AIX
Subcategory: General
Comment:

I have the following awk command
It gives a syntax error near "if" statement below.

Based on the value of s, if it greater or equal to 0, the record need to be replaced with '$1.$2.$3.$4," 0.0.0."s'

Any comments ?

awk -F"." '{s=$8-$4 if (s >= 0) print $1.$2.$3.$4," 0.0.0."s }' g1 >g2



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: July 6, 2009 at 19:40:31 Pacific
Reply:

if you want to cram them together into one line, use appropriate ";" to signify each individual awk statement.

GNU win32 packages | Gawk


0

Response Number 2
Name: pratyusha
Date: July 7, 2009 at 07:08:55 Pacific
Reply:

Thank you. It worked.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: awk syntax error

MSDN Library - Invalid Syntax Error www.computing.net/answers/programming/msdn-library-invalid-syntax-error/12881.html

syntax error in QuickBasic or?????? www.computing.net/answers/programming/syntax-error-in-quickbasic-or/11224.html

Error IN AWK Programming www.computing.net/answers/programming/error-in-awk-programming/15662.html