-
Notifications
You must be signed in to change notification settings - Fork 217
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
Rank #383
Labels
Comments
@agguser how to assign rank? Why in example for Thank you |
Workaround: $ echo "x\n10\n20\n20\n30" | mlr --c2t cat |
awk -F "\t" -v OFS="\t" '
NR == 1 { print "r", $0 }
NR > 1 { ++n; if ($1 != p) { p = $1; r = n } print r, $0 }' |
column -t -s $'\t' -o ' '
r x
1 10
2 20
2 20
4 30 |
I think this will most likely be |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to get "rank" instead of "counter"? E.g.
But I want
The command to generate ranks of field 1 would be
mlr … cat --rank 1
.The text was updated successfully, but these errors were encountered: