S
Shiraz
(i have a file with the format below:
AA,BB,CC
AA,BB,FF
AA,BB,RF
AA,QQ,VV
and after processing i need to have in it
AA,QQ,WW
throw out all the duplicates and leave none in the system
bwlow is my code: please help!!!!!!!!!!
open (FH, "<rates/temp2.csv") or die ("No input file\n");
($memLine1, $memLine2, $memLine3, $lineCount)=("","","",0);
$lineCount = 1;
while ($record11 = <FH>)
{
$lineCount=$lineCount+1;
if ($lineCount == "1") {$memLine1 = $record11; print
("xxxxxx1xxxxxx");}
if ($lineCount == "2") {$memLine2 = $record11; print
("xxxxxx2xxxxxx");}
if ($lineCount == "3") {$memLine3 = $record11; print
("xxxxxx3xxxxxx");}
if ($lineCount == 3)
{
if ( ($memLine2 != $memLine1) || ($memLine2 != $memLine3))
{
print ("Debug1 $memLine1\n Debug2 $memLin2\n Debug3 $memLine3
\n");
# print ("$memLine2");
$memLine1 = $memLine2;
$memLine2 = $memLine3;
}
$lineCount = 2;
}
}
AA,BB,CC
AA,BB,FF
AA,BB,RF
AA,QQ,VV
and after processing i need to have in it
AA,QQ,WW
throw out all the duplicates and leave none in the system
bwlow is my code: please help!!!!!!!!!!
open (FH, "<rates/temp2.csv") or die ("No input file\n");
($memLine1, $memLine2, $memLine3, $lineCount)=("","","",0);
$lineCount = 1;
while ($record11 = <FH>)
{
$lineCount=$lineCount+1;
if ($lineCount == "1") {$memLine1 = $record11; print
("xxxxxx1xxxxxx");}
if ($lineCount == "2") {$memLine2 = $record11; print
("xxxxxx2xxxxxx");}
if ($lineCount == "3") {$memLine3 = $record11; print
("xxxxxx3xxxxxx");}
if ($lineCount == 3)
{
if ( ($memLine2 != $memLine1) || ($memLine2 != $memLine3))
{
print ("Debug1 $memLine1\n Debug2 $memLin2\n Debug3 $memLine3
\n");
# print ("$memLine2");
$memLine1 = $memLine2;
$memLine2 = $memLine3;
}
$lineCount = 2;
}
}