- @set @n=0//&cscript.exe -e:jscript "%~f0"&exit /b
-
- folder = ".out文件所在文件夹";
-
- fso = new ActiveXObject("Scripting.FileSystemObject");
- fc = new Enumerator(fso.GetFolder(folder).files);
- files = [];
- for (i=0; !fc.atEnd(); fc.moveNext()) {
- fp = fc.item().Path;
- if (/\.out$/i.test(fp)) files[i++] = fp;
- }
-
- r = "Molecule,Elapsed time for docking,Anchors,Orientations,Conformations,Grid Score,Grid_vdw,Grid_es,Int_energy\r\n";
- for (i=0; i<files.length; i++)
- {
- s = fso.OpenTextFile(files[i]).ReadAll();
- s = s.match(/^Molecule:[\s\S]+?-----------------------------------/gim);
- if (!s) continue;
- s = s.join('\r\n');
- s = s.split(/\s*(Molecule|Elapsed time for docking|Anchors|Orientations|Conformations|Grid Score|Grid_vdw|Grid_es|Int_energy):\s*/);
- s = s.join(',').replace(/\s+-{2,},?/g,'\r\n');
- r += s;
- }
- fso.OpenTextFile('result.csv', 2, true).write(r);
复制代码
|