本帖最后由 pcl_test 于 2015-8-4 11:18 编辑
保存为bat文件- 1>1/* :
- @echo off
- cscript -nologo -e:jscript "%~0"
- echo;完成!
- pause & exit/b
- */
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var f1 = fso.OpenTextFile(".\\drug", 1);
- var f2 = fso.CreateTextFile(".\\结果.txt", 2);
- f2.WriteLine('Entry Target');
- while(!f1.AtEndOfStream) {
- var str = f1.ReadLine().replace(/^\s{1,6}([A-Z]+.*)/,'$1');
- if (/^ENTRY\s+/.test(str)) {
- var t = str.replace(/^ENTRY\s+/,'').split(' ');
- var s = '';
- var def1 = '';
- var def2 = '';
- }
- if (/^TARGET\s+/.test(str)) {
- def1 = 1;
- s = s+str;
- }
- var u = /^[A-Z]+/.test(str);
- if (def1&&!u){
- s = s+str;
- def2 = 1;
- }
- if (def1&&def2&&u)def1 = '';
- if (/^\/+/.test(str)){
- var m = s.match(/\[HSA:[^\]]+\]/g);
- if (m){
- for (var i=0;i<m.length;i++) {
- var v = m[i].replace(/\[HSA:([^\]]+)\]/g, '$1').split(' ');
- for (var j=0;j<v.length;j++) {
- f2.WriteLine(t[0]+' HSA:'+v[j]);
- }
- }
- }
- }
- }
- f1.Close();
- f2.Close();
复制代码
|