in reply to finding and deleting repeated lines in a file

perl -ne 'print unless $seen{$_}; $seen{$_}++' in.txt > out.txt

_______________
D a m n D i r t y A p e
Home Node | Email

Replies are listed 'Best First'.
Re: Re: finding and deleting repeated lines in a file
by marvell (Pilgrim) on Jun 19, 2002 at 14:50 UTC

    Which could be condensed to:

    perl -ne 'print unless $seen{$_}++' in.txt > out.txt

    and if you fancy replacing it directly, whilst makign a backup file:

    perl -i.bak -ne 'print unless $seen{$_}++' in.txt

    --
    Steve Marvell