I have several files, with different names. no specific format for them. But all are
.txt. For example:
example.txt flower.txt abc.com.txt
They are in the same directory. I want to search for a string line in all the files, e.g.
<html>. Then, if found, I want to extract the line where the string found. Then I want to save the search results in a results.txt file as follows:
For example, if the string
<html> was found in
abc.com.txt, then the results file will be:
example.txt,<html>[the rest of the line where html is found] abc.com.txt,<html>[the rest of the line where html is found]
How can I achieve this in linux?