Search each line in txt file for a match. - 02/07/14 12:56 PM
I don't know if the subject makes a lot of sense, but I don't quite know how to explain what I'm trying to do in a title, and I've searched a lot for answers.
So, for example, if someone sends a line of text saying:
"This is an example"
and I have a .txt file called keywords.txt which has a list of words, such as
How would I write a script that would go through the text file (by line) searching for a match in the message?
I imagined it would be something along the line of the following, but with some sort of loop for each line.
So, for example, if someone sends a line of text saying:
"This is an example"
and I have a .txt file called keywords.txt which has a list of words, such as
Code:
test example word
How would I write a script that would go through the text file (by line) searching for a match in the message?
I imagined it would be something along the line of the following, but with some sort of loop for each line.
Code:
on *:text:*:* { if (read(keywords.txt, nw, ???) isin $1-) msg # You said a keyword. }