Hi
I am using Solaris 5.10 & ksh
Wanted to loop through a pattern file by reading it and passing it to the awk to match that value present in column 1 of rawdata.txt , if so print column 1 & 2 in to Avlblpatterns.txt. Using the following code but it seems some mistakes and it is running for more time and repeatedly printing the matching pattern.. I think like Cartesian loop. Please correct me where I am wrong. Input pattern 1000 lines and data file will be containing 20000 records.
while read line
do
awk -F"," '{
if ( $1 == "'$line'" ){print $1,$2}
}' rawdata.txt >> Avlblpatterns.txt
done < searchpat.txt
---------- Post updated at 11:43 AM ---------- Previous update was at 11:36 AM ----------
Not shared sample files. Please use your own