A delimiter is what defines the fields - in other words, what $2, $6 and $9 are are defined as what the delimiter is *not*. So
foo<space>bar<tab>baz
means $1 is 'foo' and $2 is 'bar<tab>baz' if the delimiter is just a space and 'foo<space>bar' and 'baz' if the delimiter is just a tab.
As far as the single quote, there should be a final quote as well and it just protects the awk 'program' from being interpreted by the shell. The 'search' part of it is the '/and/' part, which says to apply the '{}' rule to records matching that expression. Might try checking out the info manual for gawk, which is a form of a published book on the subject.
Last edited by slakmagik; 04-07-2007 at 11:51 PM.
Reason: clarifying a point
|