Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: how to remove duplicate based on the first column value

by cbro (Pilgrim)
on Jun 10, 2003 at 15:05 UTC ( #264706=note: print w/ replies, xml ) Need Help??


in reply to how to remove duplicate based on the first column value

#!/usr/local/bin/perl my %hash; open (F,"testers.txt"); my @array = <F>; close(F); foreach (@array) { my ($key, $value) = split(/\|/); next if (exists $hash{$key}); $hash{$key} = $value; } # use this to verify while (my ($fkey,$fval) = each %hash) { print "$fkey|$fval\n"; }
I hope I didn't just do somebody's homework <g>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2016-06-28 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (349 votes). Check out past polls.