Don't ask to ask, just ask | |
PerlMonks |
Re: Re: finding and deleting repeated lines in a fileby marvell (Pilgrim) |
on Jun 19, 2002 at 14:50 UTC ( [id://175706]=note: print w/replies, xml ) | Need Help?? |
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 --
In Section
Seekers of Perl Wisdom
|
|