Just an update, I had a go with String::Approx module in perl and it seems to be getting there. Here is the code
Code:
#!/usr/bin/perl -w
use String::Approx 'amatch';
open (DICT,"first.txt") or die "Can't open dict: $!";
open (PAT,"second.txt") or die "Can't open pattern: $!";
my @in=<DICT>;
my @pat=<PAT>;
my $lines;
my @MATCHED;
my $pat;
my $patl;
foreach $pat(@pat){
my @patl=split('\t',$pat);
foreach $lines(@in){
if(my @MATCHED=amatch($patl[1],["20%"],$lines))
{
print $patl[0],":",@MATCHED;
} }
}
I am learning to program in perl, any suggestions to improve are welcome
Thanks for the reply jpollard. I haven't tried using diff yet. I will see how it works.
Thanks again