getting a field from a line in awk/sed/?

David I. Berg dberg at informix.com
Thu Jan 10 09:53:44 AEST 1991


In article <1991Jan9.162817.17038 at porthos.cc.bellcore.com> snk at bae.bae.bellcore.com (Samuel N Kamens) writes:
>
>The question I had was, how can I use UNIX tools to 
>get one field out of a line?

Use cut. The syntax is ` cut -fn -d" " ', where n is the number of the
field you wish to extract. -d" " specifies spaces as the delimiter between
fields. `man cut' will give you all the particulars.
  ___                   ___              dberg at cougar.informix.com
  /  ) __      . __/    /_ ) _       __  Informix Software Inc.  (303) 850-0210
_/__/ (_(_ (/ / (_(_  _/__> (-' -/~ (_-  5299 DTC Blvd #740; Englewood CO 80111
{uunet|pyramid}!infmx!dberg        The opinions expressed herein are mine alone.



More information about the Comp.unix.questions mailing list