|
Awk ...
This is how my input file is .
< IM.OMNI #5.2.2 SMTP; 552 cq05c.my.corp.root: your "received:" header counts of 16 exceeds maximum setting 15>
adjsahdjas kasdks 91039 sdf
sdhsahsah dfkdsjf 23948 jfkdsljf
< IM.OMNI #3.2.2 SMTP; 552 cq05c.my.corp.root: your "received:" header counts of 16 exceeds maximum setting 15>
sdkjfkdsjfkdsljfksd
sdjfdkjfdksfj
I am trying the following :
/[[#][0-9][.][0-9][.][0-9]/
{
if ((/#4.4.6/) || (/#5.1.1/) || (/#5.2.2/) || (/#4.2.2/) || (/#5.2.1/))
{ valid_rec++; }
else
{invalid_rec++; }
}
But this is not giving me the correct count. invalid_rec is incremented for every word.
Increment must happen for every line.
Please guide.
I want the valid_rec = 1 and invalid_rec = 1. How do I achieve this with awk ?
|