- 论坛徽章:
- 0
|
virus_id=001789dcd2a7971780de6e17ea6a043b<>Num_Of_Sections=10<>section_name_1=.text<>section_attri_1=Code<>section_sig_1=1450496:13dc57f1f345db57c95f7dae4ec0943e<>section_name_2=.itext<>section_attri_2=Code<>section_sig_2=5632:3956ef551a960a3329ab4762ff3414b9<>section_name_3=.data<>section_attri_3=Others<>section_sig_3=23552:94b06c9b5a772008a1a74c43f46543fb<>Num_Of_Vendors=0<>vendor_1=<>virus_name_1=<>virus_type_1=<>virus_report_1=<>
现在要提取 virus_id, section_name_${i}, section_attri_${i}, section_sig_${i} 到一个文件中去
其中${i}不确定, i 的值等于Num_Of_Sections
例如 Num_Of_Sections = 3
则输出以下3行到文件中去:
virus_id<>section_name_1<>section_attri_1<>section_sig_1
virus_id<>section_name_2<>section_attri_2<>section_sig_2
virus_id<>section_name_3<>section_attri_3<>section_sig_3
异常考虑:
1,可能不存在 Num_Of_Sections, section_name_${i}, section_attri_${i}, section_sig_${i} 等字段,例如。
virus_id=0015192a3053da230d3456cc5cfc042d<>vfile_type=.mbr<>fent=Unpacked_0<>Num_Of_Vendors=0<>vendor_1=<>virus_name_1=<>virus_type_1=<>virus_report_1=<>
2,可能存在 Num_Of_Sections 的值是N,但是实际上 section_name_${i}, section_attri_${i}, section_sig_${i} 小于 N 个的情况。
例如:
virus_id=001cfe342b263396c63d6bf336a41bad<>Num_Of_Sections=9<>section_name_1=.text<>section_attri_1=Code<>section_sig_1=577024:befce8df61e75abc611eff8a562db086<>Num_Of_Vendors=0<>vendor_1=<>virus_name_1=<>virus_type_1=<>virus_report_1=<>
因为有很多行这样的数据,现在求一个高效处理的语句,多谢 |
|