我需要从file1解析线程号、运行号和测试号,匹配file2中的测试号并将这两个值写入一个新文件。
第一个文件有以下内容:
com-0 thread-0 [ run-0, test-1201 ]: https://lp1.soma.sf.com/img/metaBar_sprite.png -> 200 OK, 682 bytes
com-0 thread-0 [ run-0, test-1202 ]: https://lp1.soma.sf.com/img/chattersupersprite.png?v=182-4 -> 200 OK, 40172 bytes
com-0 thread-0 [ run-0, test-1203 ]: https://lp1.soma.sf.com/img/chatter/wtdNowGradientbg.png -> 200 OK, 201 bytes
com-0 thread-0 [ run-0, test-1204 ]: https://lp1.soma.sf.com/img/chatter/wtdNowIcon_sprite.png -> 200 OK, 7280 bytes
com-0 thread-0 [ run-0, test-1205 ]: https://lp1.soma.sf/img/sprites/icons24.png -> 200 OK, 20287 bytes
com-0 thread-0 [ run-0, test-1206 ]: https://lp1.soma.sf.com/img/feeds/follow_sprite.png -> 200 OK, 2894 bytes
第二个文件有以下内容
1 Thread, Run, Test num, Start time, Test time, Errors, HTTP response code, EPQ
2 0, 0, 1201, 1370898725367, 154, 0, 200, 2049
3 0, 0, 1202, 1370898725523, 505, 0, 204, 0
2 0, 0, 1201, 1370898725367, 400, 0, 200, 2049
2 0, 0, 1201, 1370898725367, 1124, 0, 200, 2049
3 0, 0, 1202, 1370898725523, 1405, 0, 204, 0
所需的输出将是:
thread-0 [ run-0, test-1201 ]: https://lp1.soma.sf.com/img/metaBar_sprite.png = [154, 400, 1124]
thread-0 [ run-0, test-1202 ]: https://lp1.soma.sf.com/img/chattersupersprite.png?v=182-4 = [505, 1405]
请帮忙。提前致谢。