*****************************************
Right now i have this current system.
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is the line1 which is suppose to be grepped and displayed as a output."
My output is to search the pattern given in xxx.txt at yyy.txt and display the corresponding line as output.
Eg output: this is the line1 which is suppose to be grepped and displayed as a output.
The following script does this.(thanks rdcwayx for giving this solution)
awk -F \" 'NR==FNR {a[$2];next} {for (i in a) if ($0 ~ i) print }' xxx.txt yyy.txt
*****************************************
My proposed system is as follows.
eg:
I have two files say aaa.txt and bbb.txt.
aaa.txt with list of patterns in double quotes and its corresponding output which has to be displayed.
"this is the line1"=line one found
"this is the line2"=line two found
bbb.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use.
this is the line1 which is suppose to be grepped and displayed as a output."
my requirement is to search the pattern given in double quotes in aaa.txt at bbb.txt and if it exists in bbb.txt, the corresponding pattern after = sign in aaa.txt should be displayed.
Eg output: line one found
Please let me know if i am not clear.