lacosteaef
lacosteaef

Reputation: 55

Regex compare strings from multiple files

I have multiple XML files that contain various strings. I also have a text file of strings, some of which are contained within the XML files.

XML:

text="$$sRegister $$s is stuck at One. (VDB-5014)" uid="5014"/>

String File:

is stuck at one

I would like to print the strings that are both in my string file and my XML file. This way I can set the correct message type in the XML file. Given the high volume of messages I've been attempting to automate this process. Thoughts?

Upvotes: 2

Views: 63

Answers (1)

anubhava
anubhava

Reputation: 785128

You can use grep -f:

grep -f stringFile xmlFile

Upvotes: 3

Related Questions