Hello Monks
My objective is to search a database that is in a text file called qqq.txt with values on another text file called exp.txt. When running this script it only returns one match. If there is a match it should print the text that is associated with the value that is split from the database. I expected 3 matches because the database contains 3 values and the exp.txt file has the same 3 identical values. Its as if the script stops after one iteration. Any suggestions as to how to improve code to resolve this issue would be greatly appreciated. Thank you. And I do realize I did not have "or die" text in Open file statement. Ostra
open(INDB, "exp.txt"); open(DATA, "qqq.txt"); while(<INDB>) { $search = $_; chomp($search); seek(INDB, 0, 0); while(<DATA>) { $therec = $_; chomp($therec); ($ma,$id ) = split(/\t/, $therec); if($id eq $search){ print " $ma\n "; } } }
In reply to Threading two text files by ostra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |