怎样从文本文件中提取相应的字符串?
我的文本文件是这样的:# Patch Name: f-MS06-076:923694:0
.item N "MICROSOFT WINDOWS SERVER 2003 64-BIT EDITION" "5.2-SP0" "f-MS06-076:923694:0"
.sublist 2 R "f-MS06-016:911567:219:0"
# Patch Name: f-MS06-076:923694:1
.item N "MICROSOFT WINDOWS SERVER 2003 64-BIT EDITION" "5.2-SP1" "f-MS06-076:923694:1"
希望将提取字符串后的文本是这样的:
f-MS07-020:923694:0 MICROSOFT WINDOWS SERVER 2003 64-BIT EDITION f-MS06-016:911567:219:0
f-MS07-020:923694:1 MICROSOFT WINDOWS SERVER 2003 64-BIT EDITION
关键是判断sublist 2的问题,怎样在找到相应的ID号后,再判断并寻找sublist 2并输出相应地字串?
请各位指点,多谢。