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

Implement mlr uniq -x #1457

Merged
merged 3 commits into from
Dec 23, 2023
Merged

Implement mlr uniq -x #1457

merged 3 commits into from
Dec 23, 2023

Conversation

johnkerl
Copy link
Owner

Resolves #1456.

Examples:

$ mlr --c2p cat docs/src/example.csv
color  shape    flag  k  index quantity rate
yellow triangle true  1  11    43.6498  9.8870
red    square   true  2  15    79.2778  0.0130
red    circle   true  3  16    13.8103  2.9010
red    square   false 4  48    77.5542  7.4670
purple triangle false 5  51    81.2290  8.5910
red    square   false 6  64    77.1991  9.5310
purple triangle false 7  65    80.1405  5.8240
yellow circle   true  8  73    63.9785  4.2370
yellow circle   true  9  87    63.5058  8.3350
purple square   false 10 91    72.3735  8.2430

$ mlr --c2p uniq -g color,shape docs/src/example.csv
color  shape
yellow triangle
red    square
red    circle
purple triangle
yellow circle
purple square

$ mlr --c2p uniq -c -g color,shape docs/src/example.csv
color  shape    count
yellow triangle 1
red    square   3
red    circle   1
purple triangle 2
yellow circle   2
purple square   1

$ mlr --c2p uniq -x flag,k,index,quantity,rate docs/src/example.csv
color  shape
yellow triangle
red    square
red    circle
purple triangle
yellow circle
purple square

$ mlr --c2p uniq -c -x flag,k,index,quantity,rate docs/src/example.csv
color  shape    count
yellow triangle 1
red    square   3
red    circle   1
purple triangle 2
yellow circle   2
purple square   1

@johnkerl johnkerl merged commit 0e3a54e into main Dec 23, 2023
6 checks passed
@johnkerl johnkerl deleted the kerl/uniq-x branch December 23, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: Add -x option to uniq, to set on which fields not to group
1 participant