一。lz可先用记事本将原文件存为ANSI编码
二。以下批处理脚本代码亦存为ANSI编码- @set @v=1 /*
- @echo off
- set "tF=" &set/p "tF=原文件:"
- if not defined tF exit/b
- (cscript.exe -e:jscript "%~f0" %tF%)
- exit/b
- */
- var v=WScript.arguments;
- var fso=new ActiveXObject('scripting.filesystemobject');
- var fr=fso.opentextfile(v(0));
- var alllines=fr.readall().split('\r\n'); fr.close();
- var n, nL=alllines.length, outF='';
- for (n=0; n<nL; ++n)
- if (alllines[n].indexOf('★') != -1) {
- if (outF != '') fw.close();
- outF=alllines[n].replace(/[★\?]/g, '');
- outF+='.txt';
- fw=fso.opentextfile(outF, 2, true);
- }
- else fw.write(alllines[n]+'\r\n');
- WSH.quit(0);
复制代码
|