Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by cbro (Pilgrim)
on Jun 10, 2003 at 15:05 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264706]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found