- /*&cls
- @echo off
- cscript -nologo -e:jscript "%~f0" "C:\a.txt" "2"
- pause&exit
- */
- var fso, f1;
- fso = new ActiveXObject("Scripting.FileSystemObject");
- f1 = fso.OpenTextFile(WSH.arguments(0),1,-2);
- f2=f1.ReadAll()
- f1.Close()
- f2=f2.replace(/\r\n/g,'')
- s=new Number(WSH.arguments(1))
- for(i=0;i< f2.length;i=i+s){WSH.echo(f2.substr(i,s))}
复制代码
|