qsv
qsv copied to clipboard
easier rename
I occasionally have a CSV file with something like 80 columns and need to rename one or two of them, which is a real nuisance as I have to write the whole header line which (especially in a Makefile) becomes very difficult to read.
MILLER has something like rename 'col1,COL1,col7,COL7'
ie renaming by pairs, allowing for subsets, and I wonder if that would not be a nice feature to have?
This would be a good feature to have.
I'll add a --select
option that's widely used in qsv which should prove to be even more powerful/flexible than what MILLER provides.
Thanks, great,
Multiple --select ?
I.e. something like
qsv rename -s a A -s b B
would be be even cooler
Message ID: ***@***.***>
Stale issue message
I just want to give some ideas considering renaming headers in qsv. To improve on rename, we can use replace with the following
cat taxi.csv |qsv replace -n -s 15 'date' 'My Date'
the drawback is it is searching the whole column15
Of course there is sed piping or awk or miller, but the one that I like to use is through teip like so
cat taxi.csv |teip -l 1 -- qsv replace -n -s 15 'date' 'My Date'