xsv select name,age data.csv

Category: Data Science & Analysis

xsv select name,age data.csv

Extract just the name and age columns

The select command keeps only the named columns and drops the rest, like a column filter. Fields can be listed by name, by 1-based index, or as ranges such as 1-3. Output preserves the header order as listed. This is the xsv equivalent of cut for comma-separated data that also understands quoted fields.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.