I have a file with two columns like:
12 c
16 a
50 b
32 b
15 c
25 c
...
I want to sort the table first based on second column, then descending sort the first column, then create the third column with 'rank.word'.
so output should look like:
16 a 1.a
50 b 1.b
32 b 2.b
25 c 1.c
15 c 2.c
12 c 3.c
...
the sorting part is easy, but any idea how to get the third column with basic shell command like awk?