Process CSV with quotes (gawk) awk
Parse quoted CSV fields correctly with FPAT in gawk
gawk -v FPAT='([^,]+)|("[^"]+")' '{print $2}' data.csv
more awk
all 15 commands →
BEGIN/END blocks
awk 'BEGIN{print "Start"} {lines++} END{print lines" lines processed"}' file.txt
Two-file join on key
awk 'NR==FNR{a[$1]=$2; next} $1 in a {print $0, a[$1]}' lookup.txt data.txt
Print specific column
awk '{print $3}' file.txt
Custom field separator
awk -F: '{print $1, $3}' /etc/passwd
Filter rows by pattern
awk '/ERROR/ {print NR": "$0}' app.log