Originally Posted by tenaciousbob
Thank you thank you thank you!
Works perfectly, and stops me from banging my head against a wall.
Im gonna be cheeky now - can i just ask, what does the line 'n=split(i, s, SUBSEP)' do?
multidimensional arrays are created using concatenation of string indices. therefore if want to store like array[ip,port] , awk will concat to one string using default separater "\034". however i just chose to use "@" for visibility. when we view the array, they are something like this
and use ++ to increment the count for identical ip and port. As for the n=split(i, s, SUBSEP) line, i just want to get back the values of ip and port (stored in s), so i can print your desired output. hope you understand.