I have a file in the format as follows:
$ cat file.txt 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199
What's the best way to parse the file
file.txt into a format like:
188.8.131.52: 2 184.108.40.206: 1 220.127.116.11: 1 18.104.22.168: 3
In other words, I want to loop through the file and count the number of times each IP address appears. I've already run it through
sort so all the IP addresses are in order and directly after each other.