I have a log file of 10 hits e.g. one line is:
127.0.0.1 - - [10/Oct/2007:13:55:36 0700]"GET /index.html HTTP/1.0" 200 2326 "http://www.example.com/links.html" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)"
The format of each line is the same i.e. the IP address is always at the start.
I've currently read in the file using fopen and fgets but now I want to count how many unique IPs there are in the file, as well as count how many times an IP 'hits'. Not sure how I would attempt this.. Any tips on how I would go about doing this?