js 也挺方便,encodeURI 你懂得
保存代码到 test.js,拖动要处理的文件到 test.js 图标上开始执行:- fso = new ActiveXObject("Scripting.FileSystemObject");
- ts = fso.OpenTextFile(WScript.Arguments(0),1);
- s = ts.ReadAll().replace(/\r\n/g,"\n");
- s = encodeURI(s).replace(/%0A/g,"\r\n");
-
- ts = fso.CreateTextFile(WScript.Arguments(0)+".txt",2);
- ts.Write(s);
复制代码
|