I have this code that I am using to remove the duplicate entries from a text file. The problem is, I had to remove the date from the entries, otherwise it would make them unique. If I wanted to keep the date, how could I compare each line and remove the duplicates while ignoring the date?
[quote:]
open (IN, 'c:\tmp00.txt');
open (OUT,'>c:\tmp01.txt');
my %hTmp;
while (my $sLine = <IN>) {
print OUT $sLine unless ($hTmp{$sLine}++);
}
close (IN); close (OUT);
[/quote]
[quote:]
open (IN, 'c:\tmp00.txt');
open (OUT,'>c:\tmp01.txt');
my %hTmp;
while (my $sLine = <IN>) {
print OUT $sLine unless ($hTmp{$sLine}++);
}
close (IN); close (OUT);
[/quote]