I wondered if I could make a script to search for files containing a string & output the found lines to a text file or clipboard.
I can see that the search & filter functions will find the file content but is it possible to grab the found lines & output them?
SaveStringToFile could be used to output the result but defining the str + parameters & deciding what to output is potentially a bit more complex.
If I wanted to find any line that included a word or phrase, & output that whole line, can I do it or should I be looking at more complex tools?
e.g.
I want any line with '
cat'
I have a file with this content
the frog sat on the mat
the cat sat on the mat
the dog sat on the mat
the fox sat on the mat
the result output should be :-
the cat sat on the matI assume I can use LF or CRLF to define lines or punctuation such as a full-stop to flag 'whole' lines.
I also like these options:-
- save string(s) as list
- save string list including filename (or name & path)
- save string(s) from multiple files as list
- Output list to clipboard
Hope that makes sense.
This may be too much for a MC script, but I'd like to play around with writing it if it is possible