Hey all. I'm new to this forum and Python.
I need a program that can search an inputted keyword through all the files that end with the ".txt" extension inside a given folder. The output should include the name of the files which contain the keyword, the sentences which contain the keyword (match exactly the word and not case-sensitive.
Lastly, the the output should be saved in a file named "Search Result.txt".
For example:
I input:
like
The output should look similar to:
FirstFile.txt:
...the word like has a very flexible range of uses...
...With LIKE you can use the following two wildcard characters in the pattern...
...Official site for People Like Us and Vicki Bennett...
...Celebs and Famous People who looks like other, um, things and stuff...
AnotherFile.txt:
...like Folke Rabe and his kid brother...
...Does your cat look like Adolf Hitler...
THANKS. :cool: