Jonathan Musto wrote at Mon, 21 Jul 2003 13:11:10 +0100:
> I have a text file which contains a list of companies:
>
> NORTH DOWN AND ARDS INSTITUTE
> NOTTINGHAM HEALTH AUTHORITY
> 1ST CONTACT GROUP LTD
> 1ST CONTACT GROUP LTD
> 1ST CONTACT GROUP LTD
> 1ST CONTACT GROUP LTD
> 4D TELECOM & KINGSTON INMEDIA
> A E COOK LTD
> A E COOK LTD
>
> etc......
>
> How can a write a simple perl script to remove the duplicates and leave just
> one of each customer?
> Any help would be great.
What have you tried so far?
Have you read
perldoc -q duplicate
[untested]
my %seen;
while (<>) {
print unless $seen{$_}++;
}
Greetings,
Janek
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]