Select columns from CSV input.
gem install dorian-csv-pluckAlso included in the aggregate gem:
gem install doriancsv-pluck [options] key [key ...] [file ...]Run csv-pluck -h for generated option details and csv-pluck -v for the installed version.
- Keys can be zero-based column indexes or header names.
--print-headers/-pincludes a generated header row.
echo a,b,c | csv-pluck 1Output:
b
printf 'id,name\n1,Dorian\n' | csv-pluck name