Reputation: 198318
I'm using csvkit to manipulate csv files, but can't find how to do this:
Does someone know how to do it?
Upvotes: 3
Views: 2043
Reputation: 2449
You could use csvcut
csvcut -c column_c,column_a data.csv > new.csv
Or csvsql
csvsql --table=x --query "select column_c,column_a from x" data.csv
If you are used to sql queries the second might be easier for you.
Upvotes: 3
Reputation: 43523
According to the documentation you linked to, csvcut
can do the job. A disadvantage would be that you have to list all of the columns.
An alternative would be to use pandas
.
Upvotes: 1