nv-l

Re: uniq command

1999-03-04 08:07:37
Subject: Re: uniq command
From: Marc Russo <mrusso AT AL.IISL DOT COM>
To: nv-l AT lists.tivoli DOT com
Date: Thu, 4 Mar 1999 07:07:37 -0600
I had a similiar problem that I managed to solve with awk.  As long as
you know which field has the value you want, awk will work.  I will see
if I can find the script I wrote, and send it to you.

Marc Russo (mrusso AT al.iisl DOT com)
International Integrated Solutions, LTD


> -----Original Message-----
> From: Lucy Premus [SMTP:lpremus AT METLIFE DOT COM]
> Sent: Wednesday, March 03, 1999 1:02 PM
> To:   NV-L AT UCSBVM.ucsb DOT edu
> Subject:      uniq command
>
> A few weeks back I had asked if there were a way to count lines that
> contained a
> field that was the same.  Most of the suggestions were to use the uniq
> command.
> I want to say thank you, it was exactly what I needed.  But now I have
> a related
> question.  Is there a way to read lines in a file containing a field
> thats the
> same and output those lines to another file; again without knowing the
> value of
> the field?  For example, my file looks like this
>
> server1 nyho
> server2 nyho
> server3 nyho
> server4 risc
> server5 risc
> server6 mlb
> server7 mlb
> server8 mlb
> server9 mlb
>
> The result will be 3 files that look as follows:
>
> server1 nyho        server4 risc         server6 mlb
> server2 nyho        server5 risc         server7 mlb
> server3 nyho                       server8 mlb
>                               server9 mlb

<Prev in Thread] Current Thread [Next in Thread>