bash - Grep search strings with line breaks -
How to use grep for the output of string 'export to excel' in the input files given below? Specifically, how to control the line breaks between search strings? Is there a switch in grep that can do this or any other command?
Input files:
file a.txt:
Blah blah ... excel to export ... blah blaza .. < / P>
file b.txt:
blah blah ... export to excel ... blah blah ..
Do you want to look for files, ignore line breaks, or do you really want to see mail lines? Are you
If you have previously, you can use tr
to convert Newline to an empty space:
tr '\ n' ' '| | Grep 'excel to export' If you can do the same thing, but you just want to use the -o flag to print the actual match. You then want to adjust your regex to include any additional references.
Comments
Post a Comment