pattern will be present as a column in another file. file_1.txt
pattern1 pattern2
pattern3 pattern4
pattern5 pattern6
cat Mainfile.txt
mine line as pattern1 and pattern2
mine line2 as pattern5 and pattern6
other then that nothing should dispaly
unwanted line
final ouput_file.txt
mine line as pattern1 and pattern2
mine line2 as pattern5 and pattern6
if both the pattern present then only display the line, problem is that pattern is present in colomnwise in file_1.txt