thunderkid
Technical User
I have a simple awk script that I am trying to get awk script to print 0 (zero) when it does not find any quantities as it searches a data file. Here is an example script
BEGIN { print "nuts", "apples" }
$1 == nuts && $8 == apples
{found++}
END { print $1, $8}
I have tried inserting the following before the last print statement, but could not get it to work:
if (found = "")
found = 0
else found = found
thanks
thunderkid
BEGIN { print "nuts", "apples" }
$1 == nuts && $8 == apples
{found++}
END { print $1, $8}
I have tried inserting the following before the last print statement, but could not get it to work:
if (found = "")
found = 0
else found = found
thanks
thunderkid