csvcsvkit

How to move column or swap two columns with csvkit?


I'm using csvkit to manipulate csv files, but can't find how to do this:

  1. move one column before or after another column
  2. swap two columns but keep others unchanged

Does someone know how to do it?


Solution

  • 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.