Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!hp4nl!and!jos From: jos@and.nl (J. Horsmeier) Newsgroups: comp.unix.questions Subject: Re: file manipulation (easy question I think) Message-ID: <981@baby.and.nl> Date: 24 Jun 91 12:30:49 GMT References: <1991Jun17.200748.19324@msuinfo.cl.msu.edu> Organization: AND Software BV Rotterdam Lines: 24 In article <1991Jun17.200748.19324@msuinfo.cl.msu.edu> jpd@tardis.cl.msu.edu (Joe P. DeCello) writes: > >What is this best (easiest) way in which to get the first word >of each line in a text file to a single line in a new text file? >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >Joseph P. DeCello III e-mail: jpd@cad.msu.edu Hi there, use awk(1), as follows: awk '{ print $1 }' file_in > file_out Jos +----------------------------------------------------------------------+ |O J.A. Horsmeier AND Software B.V. phone : +31 10 4367100 O| |O Westersingel 106/108 fax : +31 10 4367110 O| |O 3015 LD Rotterdam NL e-mail: jos@and.nl O| |O--------------------------------------------------------------------O| |O I am a Hamburger (F. Zappa 1974) O| +----------------------------------------------------------------------+