纯P- @echo off
- for /f "tokens=1* delims=@" %%i in (测试.txt) do (
- >>%%i.txt echo;%%i@%%j
- )
- pause
复制代码 bat+js- @if(0)==(0) echo off & cscript -NoLogo -E:JScript %0 <测试.txt & pause & exit & @end
- var fso = new ActiveXObject("Scripting.FileSystemObject")
- var re = /(.*?)@.*/;
- while (!WScript.StdIn.AtEndOfStream){
- var str = WScript.StdIn.ReadLine();
- var filename = str.replace(re,'$1') + ".txt"
- var f = fso.OpenTextFile(filename,8,true);
- f.WriteLine(str);
- f.Close()
- }
复制代码
|