Finding the top most crime in the whole country (sort, tail, awk)
Explore how to identify the most frequent crime in Australia by sorting a CSV file with Bash commands. Learn to use numeric sorting, pipes, and Awk for data extraction to reveal key crime statistics efficiently.
We'll cover the following...
We'll cover the following...
To find the top most crime that happened the highest number of times in Australia, we want to sort our crimedata-au.csv file by the Total column (column 11).
As mentioned earlier, Bash has a command just for doing that, and as you may have guessed, it’s called sort. However, running sort on the .csv will output all lines of the file on the screen! which is not essentially very useful.
Instead, we would like to sort the file, and ...