Example: I often have to export data from MongoDB where columns are extracted from an hierarchy, and have weird names.
mongoexport -d my_db -c my_collection --csv
-f id,geopos.coordinates.0,geopos.coordinates.1,address > data.csv
There's no direct way in csvkit to rename those columns, only remove them completely or write a pipe, something like echo "column1,column2" > my_file.csv && head +2 >> my_file.csv.
I suggest to make a tool or an option to rename columns.
I have a working version of the latter in my repo. Please write what you think of this.
Example: I often have to export data from MongoDB where columns are extracted from an hierarchy, and have weird names.
There's no direct way in csvkit to rename those columns, only remove them completely or write a pipe, something like
echo "column1,column2" > my_file.csv && head +2 >> my_file.csv.I suggest to make a tool or an option to rename columns.
Option 1: a parameter to
csvcut:Option 2: a separate tool:
I have a working version of the latter in my repo. Please write what you think of this.