awk - unix
Simple Examples Extract and print a first column from the input ps | awk '{print $1}' Extract and print a multiple columns from the input with space between each column ps | awk '{print $1, $3}' Extract and print a multiple columns from the input without space ps | awk '{print $1$3}' Extract and print a multiple columns from the input with various formatting ps | awk '{print $1">>"$2"\t"$3}' Extract and print multiple on new lines ps | awk '{print $1; print $2;}' Extract and print a columns without newline at the end ps | awk '{printf $1">>"$2">>"$3"**"}' BEGIN block This block is executed only once before processing first row in the input ps | awk 'BEGIN { print "Header" } {print $1}' ps | awk 'BEGIN { print "Header"; print "SubHeader"; } {print $1}' END block This block is executed only once before processing first row in th...