Lines & ListsLesson 367Free preview
Find Most Common Lines
This lesson is part of Web Developer Tools · All levels
Summary
Find Most Common Lines calculates the frequency of each row and displays the most frequently occurring. This tool is useful for analyzing large numbers of open comments, categories, or answers. The normalization of capital/minus and spaces is important so that small variations are not counted as distinct rows.
Key points
- Frequency is calculated from the number of appearances per row
- ♬ sort uniq -c produces a count per row
- Sort -rn sort the numbers from the largest
- The normalization of capitalisation helps to combine the same variation
- Use the top-N to limit the results to the most popular row
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.