Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Remove Duplicates!! Please Help

by cdarke (Prior)
on Jan 03, 2008 at 16:00 UTC ( [id://660235]=note: print w/replies, xml ) Need Help??


in reply to Remove Duplicates!! Please Help

Or try this:
#!/usr/bin/perl use warnings; use strict; open(FILE2,">file1.txt")|| die "Could not open: $!\n"; open(FILE3,"file2.txt")|| die "Could not open: $!\n"; my @data = <FILE3>; close(FILE3); my %hash; foreach my $_data (@data) { my $computer_name = (split(/\t/, $_data))[0]; if (! exists($hash{$computer_name})) { $hash{$computer_name} = undef; print FILE2 $_data; } } close(FILE2);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found