I m new to bash Shell scripting. I have a requirement that I have a lookup file (csv) in which there are set of strings in it like below.
file1:
text1
text2
text3
I have to check whether the strings in file1 are present in the file2.
file2:
s.no desc
1 text5
2 text3
3 text2
4 text9
If the the string in file1 is there in file2, then I have to print the output in a new file file3 with the s.no and the string found. Please help.
join -1 1 -2 2 -t $'\t' --header <(echo; sort file1) <(sort -t $'\t' -k2,2 file2) -o 2.1,2.2