Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Remove Duplicates!! Please Help

by kirillm (Friar)
on Jan 03, 2008 at 15:37 UTC ( [id://660217]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -lnae 'print unless $seen{$F[0]}++' < file2.txt > file1.txt
    
  2. or download this
    $ perl -MTie::Hash::Indexed -lane '\
      sub BEGIN {tie %seen, "Tie::Hash::Indexed"};\
      sub END {print $seen{$_} for keys %seen};\
      $seen{$F[0]} = $_'  file2.txt > file1.txt
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://660217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-05-29 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found