How do I get only the lines with the strings given by list_of_od_strings.txt file_with_strings_in_lines.xml?
This question is similar to Select lines from text file which have ids listed in another file insofar that I have got a file list_of_od_strings.txt with strings that exist in file_with_strings_in_lines.xml. The lines with one of these strings should be printed. The mentioned question has ids in the first file that consist of only one word.
My case here is different insofar, that in ids.csv ids are given as a combination of two to four strings in a row like 'one two 333 four'.
grep -wFf list_of_id_strings.txt file_with_strings_in_lines.xml
gives me an output, where I see the found strings of list_of_id_strings.txt highlighted. However, the lines without strings of list_of_id_strings.txt in file_with_strings_in_lines.xml also show up. To say, I see the whole list_of_id_strings.txt in the output.
How do I get only the lines with the strings given by list_of_od_strings.txt file_with_strings_in_lines.xml?
list_of_id_strings.txt
contain an empty line? – steeldriver May 24 '19 at 12:20