sort-uniq-count-rank


This documentation reflects EDirect version 7.60, released on 11/14/2017.

We strive to keep this documentation up-to-date with the latest release. If you are looking for documentation on a more recent version of EDirect, or to find out more about new EDirect releases, please see the Release Notes of NCBI's EDirect documentation.


The sort-uniq-count-rank command combines a series of Unix commands (including sort and uniq) to sort a series of lines of text alphabetically, grouping together the duplicate lines. The function then counts how many occurrences there are of each unique line, removes all duplicate lines, and then sorts the list of unique lines by how frequently they occur, from most frequent to least frequent. The numerical frequency count is also displayed.

Input

One or more lines of text.

Output

One or more unique lines of text, accompanied by frequency counts, sorted from most frequent to least frequent.

Arguments

The sort-uniq-count-rank command does not accept arguments.

Example

Given a series of rows of text (for example, a list of author names):

Noy S
Iverson GL
Del Bigio MR
Sawyer Q
Vesci B
Zukerman SL
Iverson GL
Wallace PW
Stern RA
Noy S
Baugh CM
[...]

The sort-uniq-count-rank command will output:

12      Iverson GL
12      Zuckerman SL
11      Guskiewicz KM
11      Kerr ZY
11      Solomon GS
10      Covassin T
10      Stern RA
9       Arnett PA
9       Baugh CM
9       Kroshus E
9       Mihalik JP
[...]