I am trying to find a way to use awk to start printing only once it finds the search parameter and print only a couple of columns following it.
To try to explain a little better I am looking over a log file that prints a lot of information as a single line. I want to take and extrapolate only certain aspects of that line. IE there's a big file with this line somewhere in it:
blahblah blah blah there is a lot of information here for name: John Doe and it just keeps on going and doesn't stop.
I want it to search for name and only print out:
name: John Doe
I know I can use the column segment, but I don't actually know where in that line name will be in different files.
grep -o
for this?grep -o 'name: ([A-Z][a-z]* )*' /path/to/input
a lot of good information
. I mean, will it always be prefixed byname:
?