in reply to == uniq
A related problem I once had fun with. Process a file and only print lines once (unlike uniq no assumption of sorted input). That isn't quite what you wanted, but here was the fastest version I could come up with in Perl:
(Yes, details like where to place the plusses mattered.)perl -ne 'print if 1 == ++$s{$_}' < in > out
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(dkubb) Re: (2) Printing unique lines in a file
by dkubb (Deacon) on Feb 13, 2001 at 13:25 UTC | |
|
Re: Re (tilly) 1: == uniq
by MeowChow (Vicar) on Feb 13, 2001 at 08:54 UTC | |
by tilly (Archbishop) on Feb 13, 2001 at 08:57 UTC |