Andreas Schwab wrote:
Richard Neill <[EMAIL PROTECTED]> writes:

For example, consider a data file:

  apples: 12
  oranges: 15
  bananas: 20

How many oranges do I have?

awk '/oranges/ { print $2 }'

Andreas.


Dear Andreas,

Thanks for your email. Sadly, my contrived example is oversimplified, such that the sub-section is in the nth field, where n is known in advance - but that isn't necessarily true.

Regards,

Richard


Reply via email to