开发者

Find same rows in the list

I have a list of telephone numbers in file telephones.txt. There are more over 2000 telephone numbers in that list.

File format: each row contains one telephone number.

I need to find all equal (same?) telephone numbers. The output should contain only telephone numbers which have more than 1 record in the list (I hope I 开发者_如何学Pythonwrote it right in english).

Sample of output: telephoneNumber count

How can I do this ?

.net 2.0


I would read the list into memory (2000 numbers is small). Sort the list and then walk the list and output the telephone and count when when the previous telephone number does not match the current telephone number.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜