The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Build Status

CSVAWK

This simply passes a CSV file to AWK with a Perl wrapper. It lets you:

Output specific fields:

sh csvawk '{ print $foo, $bar }' file.csv

Output the header and records matching a specific condition:

sh csvawk 'NR==1 || $foo=="bar" { print }' file.csv

Edit a single field and output:

sh csvawk 'NR>1 { $foo="bar" } { print }' file.csv

Count records matching certain conditions:

sh csvawk '$foo=="bar" { ++count } END { print count }' file.csv

Pretty print your program in gawk and inspect it:

sh csvawk -g '{ print $foo }' file.csv -- --pretty-print less awkprof.out

List headers, one per line:

sh csvawk 'NR == 1 { for (i = 1; i <= NF; i++) print $i }' file.csv