csvtk
csvtk copied to clipboard
Enhancement Request for csvtk summary
Prerequisites
- [ YES] make sure you're are using the latest version by
csvtk version - [ YES] read the usage
Describe your issue
- [x] describe the problem Isn't really a problem, but an enhancement request: Can we use index ranges for performing functions?
for command purposes, I'm taking "uniq" as example here:
csvtk summary -t -g f1 -f 2:uniq,3:uniq,4:uniq < data.tsv
Request it format like how unix cut does: cut -d$'\t' -f2-4 < data.tsv
csvtk summary -t -g f1 -f 2-4:uniq < data.tsv
- [x] provide a reproducible example where data.tsv is the following
name C2 C3 C4
bob 1 3 5
bob 3 4 8
rick 2 3 7
lolo 1 2 3
This should be the outcome of the command: csvtk summary -t -g name -f C2:uniq,C3:uniq,C4:uniq
name C2:uniq C3:uniq C4:uniq
bob 1; 3 3; 4 8; 5
lolo 1 2 3
rick 2 3 7
However, the same could be written as: csvtk summary -t -g name -f C2-C4:uniq or csvtk summary -t -g 1 -f 2-4:uniq
going by either digital names or column index.
If the above is already available, can you share the syntax? I've been wrecking my head over it!
Thank you for the wonderful tool!