[nycbug-talk] Scripting Question

Marc Spitzer mspitzer at gmail.com
Fri Mar 9 14:25:14 EST 2007


On 3/9/07, Marc Spitzer <mspitzer at gmail.com> wrote:
> On 3/9/07, James <quincy111 at gmail.com> wrote:
> > Kevin Reiter wrote:
> > > Follow-up question:  Is there a quick and dirty way to check for duplicate entries, and eliminate them if they exist?
> > >
> > > For example:
> > >
> > > 1
> > > 1
> > > 2
> > > 3
> > > 3
> > > 3
> > > 4
> > > 5
> > >
> > > I need: 1,2,3,4,5
> > >
> > > Is there a quick check/solution for this?
> > >
> >
> > uniq should work, no?
>
> no, uniq assumes a sorted list.  It will only remove things when they
> are alike AND next to each other, like so:
> -bash-3.00$ cat xxx
> 1
> 1
> 2
> 1
> 1
> -bash-3.00$ uniq< xxx
> 1
> 2
> 1
> -bash-3.00$
>
> marc
> --
> Freedom is nothing but a chance to be better.
> Albert Camus
>


-- 
Freedom is nothing but a chance to be better.
Albert Camus



More information about the talk mailing list