Hi,
I have two files:
File1 (tab-delimited and two columns):
Ex_efxb 0.0023
MSeef 2.3000
F_ecjc 0.3338
MWEEI -0.111
DDAIij 17.777
File2:
MSeef 2.3000
F_ecjc 0.3338
I want to search the content of File one using the content of File 2 and then display the output as follows:
Date of search:
The following matches were found in File 1:
MSeef 2.3000
F_ecjc 0.3338
Here's is my perl script which did not work for the above tasks:
#!C:\bin\perl.exe
my $REPORT_FILE = 'outFile.txt';
$F1 = 'File1.txt';
open(RF,"<$F1") || die "can't open $F1 $!";
$F2 = 'File2.txt';
open(RXNs,"<$F2") || die "can't open $F2 $!";
close F1;
close F2;
my $line = <RF>;
@f1 = split /\t/, $line;
my $line = <RXN>;
@f2 = $line;
open(DATA,"+>OutFile.txt") or die "Can't open data";
foreach $a (@f1){
$flag = 0;
foreach $b (@f2){
if ($a eq $b){
print DATA $line{1}."\t".$line{2}."\n" ;
$flag = 1;
last;
}
if ($flag==0){
print DATA "";
}
}
}
close DATA;
Please help make this script work!