我有一个文本文件,类似以下格式:
#----------
#
# department name
# contact: a b, a.b@company.ca, 416-xxx
# location: bc 103
# Netmask: 255.255.255.224
netname-a 111.111.111.128
#----------
#
# department name
# contact: c d, c.d@company.ca, 416-xxx
# location: bc 104
# Netmask: 255.255.255.0
netname-b 111.111.110.0
....
这个文件很长,我需要读出email, networkmask,netname, network 并转化
成以下格式文件;
netname-a;111.111.111.128:255.255.255.224;a.b@company.ca
netname-b;111.111.110.0:255.255.255.0;c.d@company.ca
...
请问有何方法?
多谢
#----------
#
# department name
# contact: a b, a.b@company.ca, 416-xxx
# location: bc 103
# Netmask: 255.255.255.224
netname-a 111.111.111.128
#----------
#
# department name
# contact: c d, c.d@company.ca, 416-xxx
# location: bc 104
# Netmask: 255.255.255.0
netname-b 111.111.110.0
....
这个文件很长,我需要读出email, networkmask,netname, network 并转化
成以下格式文件;
netname-a;111.111.111.128:255.255.255.224;a.b@company.ca
netname-b;111.111.110.0:255.255.255.0;c.d@company.ca
...
请问有何方法?
多谢