Hi I'm in the need of a script that basically takes two files and generates a 3rd. It reads from fileA and fileB and copies lines from fileA if they start by a word of fileB.
for example
fileA
The dog is beautful
Where is your cat
Why are you sad?
Help me!
fileB
The
Where
tree
dog
fileC would be like this
The dog is beautful
Where is your cat
I have a fileA with the following format
word(s) ||| word(s) ||| number
word(s) ||| word(s) ||| number
word(s) ||| word(s) ||| number
and a fileB which is just plain text. I want to copy into fileC the lines from fileA where the first word or sequence of words (everything before the first ||| delimiter) exists anywhere in the fileB.
For example if I have
abc def ||| foobar ||| 123
I want to copy the line only if fileB contains "abc def", not just abc.