Assuming the following input:
$ cat example {many lines of text} Col1 Col2 Col3 foo bar 2 bar baz 3 baz bar 8 bar foo 0 foo baz 9 baz bar 3 {many more lines of text}
The following two awk snippets parse the following data:
cat example | awk -v 'RS=\n\n' '/^Col1 /' | awk '$2 == "bar" && $3 > 1 {print $1}' foo baz baz
How to combine two fragments into one awk bit, for example.
awk ' ... ... ... ' example
source share