From: Ruby Newbee Date: 2009-11-22T12:00:15+09:00 Subject: Re: How to match and count Yes, thanks. 2009/11/22 Phrogz : > On Nov 21, 7:09 pm, Ruby Newbee wrote: >> awk '{if ($4~/something/) {i+=1}} END {print i}'  file.txt >> >> That means if a line's 4th field match "something" then increase the >> counter by 1. >> How to write the corresponding ruby code? > > What is a 'field'? Whitespace delimited? > >