rank - Rank lines of text
This document describes version 0.007 of rank (from Perl distribution App-rank), released on 2018-05-01.
rank [OPTION]... [FILE]...
rank ranks lines of text, by default using the first field as the sort key (can be changed with --sort-field option). When there are multiple lines that have the same sort key, rank will assign the same rank to the lines. Finally, the lines will be displayed with the ranks, starting from the highest ranked (1).
rank
--sort-field
Sample input:
21 ujang 30 budi 50 atang 75 robi 89 parjiyem 77 nono 75 tedi
Sample output using rank -n (a.k.a. rank --numeric-sort):
rank -n
rank --numeric-sort
1 89 parjiyem 2 77 nono 3 75 robi 3 75 tedi 5 50 atang 6 30 budi 7 21 ujang
Sample output using rank -np (a.k.a. rank --numeric-sort --show-percentile):
rank -np
rank --numeric-sort --show-percentile
1 100.000 89 parjiyem 2 85.714 77 nono 3 71.429 75 robi 3 71.429 75 tedi 5 42.857 50 atang 6 28.571 30 budi 7 14.286 21 ujang
Sample output using rank -n --calc-percentile 5,25,50,75,95):
rank -n --calc-percentile 5,25,50,75,95
95.000 84.80000000 75.000 75.50000000 50.000 56.25000000 25.000 27.75000000 5.000 15.15000000
0 on success.
255 on I/O error.
99 on command-line options error.
--action=s (default: rank)
Valid values: rank, calc-percentile
calc-percentile
The default action is to show ranking (rank).
Action calc-percentile will calculate specific percentiles. Usually you just specify --calc-percentile a,b,c,... to set action to calc-percentile.
--calc-percentile a,b,c,...
--calc-percentile=f1,f2,...
Imply --action=calc-percentile. Calculate specific percentile(s). Will use linear interpolation to get the percentile values.
--action=calc-percentile
--reverse, -r
--ignore-leading-blanks, -b
--ignore-case, -i
--field-separator, -f (default: Tab)
--sort=s
Valid values: numeric, ascii.
numeric
ascii
--numeric-sort, -n
Shortcut for --sort=numeric. By default numeric sort order is descending instead of ascending. To do ascending sort, add -r.
--sort=numeric
-r
--sort-field=i (default: 0)
rank=s (default: default)
Change ranking system. The default is to have all lines that have the same sort keys to be ranked the same, but the next ranking will skip numbers:
The no-skip ranking system will not do these skips:
no-skip
1 89 parjiyem 2 77 nono 3 75 robi 3 75 tedi 4 50 atang 5 30 budi 6 21 ujang
The no-same ranking system will assign different ranks to lines that have the same sort key:
no-same
1 89 parjiyem 2 77 nono 3 75 robi 4 75 tedi 5 50 atang 6 30 budi 7 21 ujang
--no-show-rank
--show-percentile, -p
--help, -h
--version, -v
Please visit the project's homepage at https://metacpan.org/release/App-rank.
Source repository is at https://github.com/perlancar/perl-App-rank.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-rank
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
sort
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::rank, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::rank
CPAN shell
perl -MCPAN -e shell install App::rank
For more information on module installation, please visit the detailed CPAN module installation guide.