csvcut -c name,age data.csv

Category: Data Science & Analysis

csvcut -c name,age data.csv

Extract the name and age columns

The -c flag selects columns by name or 1-based index, here name and age. Output keeps the header row and only the chosen fields. Column order in the output matches the order you list them, which can differ from the input. This is csvkit's equivalent of xsv select.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.