Path: utzoo!attcan!uunet!bellcore!porthos!bae!snk From: snk@bae.bae.bellcore.com (Samuel N Kamens) Newsgroups: comp.unix.questions Subject: getting a field from a line in awk/sed/? Message-ID: <1991Jan9.162817.17038@porthos.cc.bellcore.com> Date: 9 Jan 91 16:28:17 GMT Sender: @porthos.cc.bellcore.com Reply-To: snk@bae.bae.bellcore.com (Samuel N Kamens) Organization: Bell Communications Research Lines: 38 I'm sorry if anybody already got this -- I posted it yesterday, and it doesn't seem to have made it off the machine I posted it on. The question I had was, how can I use UNIX tools to get one field out of a line? The input will look like this: Rank Owner Job Files Total Size 1st fort 24 (standard input) 40354 bytes 3rd root 178 standard input 57 bytes 4th mike 25 (standard input) 26895 bytes 6th rdg 686 (standard input) 733 bytes 7th bdt 688 (standard input) 31053 bytes And the output should look like this: Owner fort root mike rdg bdt Any ideas? ------------------------------------------------------------------------------- Sam Kamens Bell Communications Research snk@cellar.bae.bellcore.com Phone: (908) 699-7381 444 Hoes Lane Room RRC 1C-205 Piscataway, NJ 08854