hi,

i want to remove duplicate lines from one file(original file), and save 
the result to another file.

the origianl file like this:

--------------------------------------------------------------------------------------------
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-------------------------------------------------------------------------------------------

with each email address a line. I want to remove the duplicate 
lines(emais adresses) and

save the result to a new file.

I wrote a program , but it output nothing. can someome help ?

Thanks a lot.

                                                          kevin

-------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
#######################
#Remove the duplicate line   #
#from a orginal file and save #
#the result to a file.             #
#######################
print "Enter the file that has duplicate lines.\n";
$Dupli_file=<stdin>;
chomp;
print "The file you select is '$Dupli_file'\n";
open (Dupli_file,"$Dupli_file");
print "Please select the file you want to save the result to:\n";
$Resu_file=<stdin>;
chomp;
print "The result file is $Resu_file\n";
open (Resu_file,">$Resu_file");
while (<Dupli_file>)
{
    $orin_line=$_;
    while (<Resu_file>){
        if("$_" eq "$orin_line")
        {
        next;
        }
        print Resu_file "$orin_line";
    };
}

-----------------------------------------------------------------------------------



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to