Here is the code I have for opening the file and parsing the tab @ molecules and @locus are text files which are loaded into arrays
my @locus_small = ();
my $line;
foreach $line (@locus) {
my @tokens = split(/\t+/, $line);
unless(scalar @tokens < 6) {
push(@locus_small, "$tokens[0]\t$tokens[1]\t");
}
}
Then I search and print the @found which is based on locus_small but I want the @locus which matched.
So really what I want to do is only search a few columns for a match but print the whole row if there is a match.
foreach my $molecule (@molecules) {
my @found = grep /\Q$molecule\E/i, @locus_small;
if (@found) {
print OUTDATA ($molecule, ": \n\t", join "\t", @found);
}
}
|