View Single Post

   
  #5 (permalink)  
Old 02-19-2008, 09:20 PM
Loki Harfagr
 
Posts: n/a
Default Re: OT How to count occurances in a text file

Le Mon, 24 Jan 2005 23:24:45 -0800, buck a écrit*:

> Can you please help me determine where there are unmatched quotes (")
> in my .mailfilterrc file?
> if count=0 then ignore # Skip zero and
> if count<>2 then echo $LINE # two; show all others
> done <.mailfilterrc


Now, another, funny but simpler one :

#:> awk '{if(NF){if ((NF+1)%2){print NR "\t" NF-1} }; i=0}' FS=\"
..mailfilterrc

which'll give output like :

1 1
4 1
5 1
10 1
23 13


Cheers :-)
Reply With Quote