本帖最后由 pcl_test 于 2016-1-10 14:47 编辑
- @if (0)==(0) echo off
- cscript -nologo -e:jscript "%~0" < link.txt > out.txt
- pause & exit
- @end
-
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var arr1 = fso.OpenTextFile('DTI_one.txt').ReadAll().split('\r\n');
- var arr2 = fso.OpenTextFile('DTI_two.txt').ReadAll().split('\r\n');
-
- var map = [];
- for(var i=0; i<arr1.length; i++){
- var drug_ID = arr1[i].replace(/(\S+).+/, '$1');
- map[drug_ID] = arr1[i].replace(/\S+\s+(.+)/, '$1');
- }
-
- for(var i=0; i<arr2.length; i++){
- var drug_ID = arr2[i].replace(/(\S+).+/, '$1');
- map[drug_ID] += '\t' + arr2[i].replace(/\S+\s+(.+)/, '$1');
- }
-
- var arr = WSH.StdIn.ReadAll().split('\r\n');
- for(var i=0; i<arr.length; i++){
- var m = arr[i].split(/\s+/);
- if(map[m[0]]&&map[m[1]]) {
- WSH.Echo(arr[i] + '\t' + map[m[0]] + '\t' + map[m[1]]);
- }
- }
复制代码
|