J
jason
The below simple code works at removing dups from a 20k record file.
Looking for somebody to explain how/why.
$db = "workb.txt";
open (FILE,"$db");
@lines=<FILE>;
close(FILE);
foreach $key (@lines){
$lines{$key} = 1;
}
@lines = keys(%lines);
print @lines;
I understand I am adding a key = 1 to every line (is it to every
line?), but when we recreate @lines what exactly is keys(%lines)
doing/saying? I see that %lines contains 1+unique records in the
file).
Thanks.
Looking for somebody to explain how/why.
$db = "workb.txt";
open (FILE,"$db");
@lines=<FILE>;
close(FILE);
foreach $key (@lines){
$lines{$key} = 1;
}
@lines = keys(%lines);
print @lines;
I understand I am adding a key = 1 to every line (is it to every
line?), but when we recreate @lines what exactly is keys(%lines)
doing/saying? I see that %lines contains 1+unique records in the
file).
Thanks.