【发布时间】:2013-11-15 16:55:35
【问题描述】:
我有一个包含数千个 mac 地址的大文件 (~10-100MB),每个 mac 地址可能在文件中出现多次。 我想编写一个返回唯一 MAC 地址总数的 Perl 脚本(或 Python 脚本)。例如,如果我的文件包含
"hostmac":"112233445566"
log here
"hostmac":"23AA23AA23AA"
log here
"hostmac":"23AA23AA23AA"
log here
"hostmac":"112233445566"
log here
"hostmac":"77AABB8899CC"
log here
"hostmac":"112233445566"
log here
"hostmac":"112233445566"
log here
"hostmac":"EEFF00112233"
log here
我希望我的 Perl/Python 脚本返回 4,因为我有 4 个唯一的 mac 地址。
【问题讨论】:
-
到目前为止你有什么收获?
-
每一行的格式是否相同?