>_ IzzyLab

Topic breakdown

Counting frequencies is accumulation in an awk associative array, where the key (a word) indexes a counter, and incrementing it on each line yields the final repeat count. An awk array is unordered, so "top-N" is a separate stage: the output from the END block is piped into external sorting and head. Here it's important to be able to sort with sort by a specific column as numbers and in reverse order, rather than lexicographically.

What's checked

  1. the top 3 by frequency is correct

What it looks like