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