Closed bpshaver closed 1 year ago
I don't know awk so just gonna say this looks good
The general form of an awk
invocation is
awk 'program' file
or you can pipe input to it. Or it can receive from stdin.
an AWK program contains one or more lines like
pattern { action }
where one or both of a pattern and an action can be supplied.
AWK splits lines in whitespace by default, so you could print every 3rd field where the second field is above zero like this:
awk ' $2 > 0 { print $3 } ' input.txt
Basically, a lot of people grep then pass things to AWK because they only know about the { action }
part but not the pattern part.
Ben read the first fews of the AWK book