[ILUG] awk help required

kevin lyda kevin at suberic.net
Fri Aug 3 11:33:55 IST 2001


my answer is below, but please consider:

    my address is:

	ballinvoher
	caherlistrane
	co. galway
	ireland

    cheques (happy paul?) made out in irish pounds are preferred.  as an
    alternative, you can send me a compaq ipaq, a 21 inch monitor (lcd),
    a titanium g4, etc.

On Fri, Aug 03, 2001 at 11:07:28AM +0100, hrishy wrote:
> i want to have the count of not found by label.i am
> using the follwoing awk script but the count si
> displayed as zero.why is that. 

because you're not seeing how awk works.  this will do what you want:

> BEGIN{
> FS="|"
> count=0
> if  ( $1 ~ /Label/  && $2 ~ /Not Found/ )
> 	{count=count+1}
> print count
> }
> END

BEGIN {FS="|"}
$1 ~ /Label/ && $2 ~ /Not Found/ {count=count+1}
END {print count}

however, this won't count per label.  just overall.

kevin

-- 
kevin at suberic.net          simple four line sigs -
fork()'ed on 37058400      bandwidth friendly; nice to do.
meatspace place: home      some admins clueless.
http://suberic.net/~kevin          --netiquette haiku 2001




More information about the ILUG mailing list