I have a list of strings, say file1.txt:
a
B
ccc
D
E
f
and another list of strings, i.e. file2.txt:
a x y z
43 5 B aa_f
<|ccc
|D>
E
FFF
I want to check, for each line, that file2.txt contains the trimmed string (so no whitespaces around) contained in the respective line of file1.txt.
For example, line 2 in both files contains B
, so this test should evaluate to true
. However, the last line in both files are not in the substring relation, since file1.txt contains f
and file2.txt does not have any f
character in that line.
ccc
orD
, or are you only interested in strings delimited by whitespace? – Kusalananda Feb 03 '20 at 07:45true
and one linefalse
? – Philippos Feb 03 '20 at 07:47