So I have a large file which is in a columns comprised of cities. I want to write a program that will find the total number of instances of each city and display it in a new file. How should I go about doing that.
This is an example, there are way more values than this
If the file is like this
City
Manhattan
Cork
Manhattan
Chennai
Chennai
How output should look
City
Manhattan 2
Cork 1
Chennai 2
uniq -c
after asort
. – xenoid Aug 06 '19 at 14:47