Hi all,
i got problem about pattern matching.Could u all please give me some idea how i can do pattern macthing between 2 file.
ok this is the scenario..
i got file A and file B.File A is existing data and File B is a downloadable data.What i'm going to do is i want to update file A using file B.This is my coding.i think there are a lot of mistake.I'm glad if u all could give me an idea or an advice.tq
open (INPUT, "customize_rule.txt"
|| die "can't open file";
#my @Rule = <INPUT>;
$pattern = 'IDS\d{2,3}';
while (<INPUT>)
{
if (/$pattern/)
{
$t = $_;
#print "$t\n";
#print "$1\n";
open (OUT, "existcustomize.txt"
|| die "can't open file";
while (<OUT>)
{
if ($t ne $_)
{
open (CUSTOMIZE, ">>existcustomize.txt"
|| die "can't open file";
print CUSTOMIZE $t;
print "$t\n";
last;
}
else
{
print "rule already exist\n";
last;
}
}
}
}
print "\n\n";
close(INPUT);
close(OUT);
close(CUSTOMIZE);
i got problem about pattern matching.Could u all please give me some idea how i can do pattern macthing between 2 file.
ok this is the scenario..
i got file A and file B.File A is existing data and File B is a downloadable data.What i'm going to do is i want to update file A using file B.This is my coding.i think there are a lot of mistake.I'm glad if u all could give me an idea or an advice.tq
open (INPUT, "customize_rule.txt"
#my @Rule = <INPUT>;
$pattern = 'IDS\d{2,3}';
while (<INPUT>)
{
if (/$pattern/)
{
$t = $_;
#print "$t\n";
#print "$1\n";
open (OUT, "existcustomize.txt"
while (<OUT>)
{
if ($t ne $_)
{
open (CUSTOMIZE, ">>existcustomize.txt"
print CUSTOMIZE $t;
print "$t\n";
last;
}
else
{
print "rule already exist\n";
last;
}
}
}
}
print "\n\n";
close(INPUT);
close(OUT);
close(CUSTOMIZE);