Is there any predefined function in PHP or any other scripting language that performs the same function that GREP or FINDSTR performs in console. I want to perform the following code in scripting language;
findstr /i/g:finddata.txt /f:filelist.txt > results.txt
here, finddata.txt is the file containing the words to be matched, filelist.txt contains the list of files from where the words be matched and result.txt prints the output.
I wanted to match few words stored in a file to another file and print all the sentences that contains the matched words in another file. if it could highlight the matched words (color/italics/bold etc.) it will be be much appreciated.