Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request for csvtk summary #143

Open
2 tasks done
harish0201 opened this issue May 25, 2021 · 0 comments
Open
2 tasks done

Enhancement Request for csvtk summary #143

harish0201 opened this issue May 25, 2021 · 0 comments

Comments

@harish0201
Copy link

harish0201 commented May 25, 2021

Prerequisites

  • [ YES] make sure you're are using the latest version by csvtk version
  • [ YES] read the usage

Describe your issue

  • 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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants