POSIX awk CSV parser

Source (2.25KiB; nawk, bash)
csvawk is a nawk CSV wrapper capable of parsing formatted CSV output; it handles nested and escaped input quotes.
Being the product of insobriety, it quickly starts eating CPU with larger files. Caveat emptor.

Usage

Sample (modified) nikto output:
csvawk '{ print $1" ("$2":"$3") " $NF }' <<EOF
"moriendi.org","134.209.87.37","443","OSVDB-0","GET","/","The \"X-XSS-Protection\" header is not defined. This header can hint to the user agent to protect against some forms of XSS"
EOF

Produces:
moriendi.org (134.209.87.37:443) The "X-XSS-Protection" header is not defined. This header can hint to the user agent to protect against some forms of XSS

Limitations

csvawk does not accept any options other than -f, awk's error output is malformed (line numbers are offset), and there ought to be plenty of bugs (and bad design desicions).

csvawk cannot be included via -f into a regular awk command.

csvawk has not been tested extensively, though reasonable edge cases have been considered.

Neither speed nor efficiency were considered while assembling this script.