#! usr/bin/perl use strict; use warnings; # opening the input lexicons open (GENE,"/home/stanley/Desktop/Gene.txt"); open (TARGET, "/home/stanley/Desktop/Target.txt"); my $target; my $gene; # opening fulltext open (IF, "/home/stanley/Desktop/18048320.txt"); my $text = ; my @splittext = split (/[.] [A-Z]/, $text); close (IF); # opening output file open (OF, ">/home/stanley/Desktop/Local.txt"); # Parsing Text for $gene () { chomp $gene; while ($target = ) { chomp $target; foreach my $line (@splittext) { if ($line =~ /.+?($gene).*(localizes to|held|located in|localization|translocated to|targets|reaches|exported|export).*($target).+?/ig) { print OF $1."\t".$2."\t".$3."\n"; } } } } close (OF); close (GENE); close (TARGET);