in reply to grep question using multiple lines
I am not sure what the criteria for finding the data is exactly. The example shows an email address, but you say the search text could be anything. Assuming per the example you are looking for the text following "constant=" up to the first space and there is only one instance per line, this worked for me:
I tend to oversimplify things, so it may not be what you are looking for. But it is one line and it returns the data you were looking for.perl -nle 'while(m/constant=(.*)\s/g){print "$1"}' /home/jamie/example +.txt
Jamie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: grep question using multiple lines
by backstab (Novice) on Dec 28, 2008 at 03:58 UTC | |
by skx (Parson) on Dec 28, 2008 at 12:53 UTC |