@Shva wrote:
I would like to compare string in two files and extract the word which is same in other one file.
To do this, we need a few clarifications:
- What is a "word". (Probably a consecutive string of readable characters, separated by one or multiple spaces, tabs, newlines, returns, etc.)? You need a complete list of all word separators.
- Is the "other file" just a list of keywords or is it also a long, arbitrary text file?
- What should happen if more than one word matches (get the first match, get all matches, etc)?
- What is "extract"? Do you want to delete the matching word form file 1 or just know which word matched?
Could you give an example?