- @set @n=0;//&dir /b *.txt|cscript -nologo -e:jscript "%~0" & pause & exit/b
-
- fso = new ActiveXObject("Scripting.FileSystemObject");
- while (!WScript.StdIn.AtEndOfStream) {
- file = WScript.StdIn.ReadLine();
- f = fso.OpenTextFile(file, 1);
- txt = f.ReadAll();
- f.Close();
- txt = txt.replace(/(\S+)(\s+\S+\s+)(\S+)(.*)$/mg, "$3$2$1$4");
- f = fso.OpenTextFile(file, 2);
- f.Write(txt);
- f.close(); f = null
- }
复制代码
|