
[已解決]BAT批處理如何截取xx與xx之間的文本最后由 rzzm 于 -4-25 20:57我翻了一些帖子,發現下面這個我看得懂,也能改,不過他是刪除之間的內容,我想把內容保存
- @set @n=0;
- arg = Wscript.Arguments(0);
- fso = new ActiveXObject(scripting.FileSystemObject);
- while (!WSH.StdIn.AtEndOfStream) {
- f = WSH.StdIn.ReadLine();
- txt = fso.OpenTextFile(f,1).ReadAll();
- if (arg == 1) {
- txt = txt.replace(/[sS]*孤寂之狼/,);
- } else {
- if (arg == 2) {
- txt = txt.replace(/97言情小說網[sS]*?free97.cn/ig,);
- } else txt = txt.replace(/收藏此書加入書簽[sS]*$/,);
- };
- fso.OpenTextFile(f,2).Write(txt);
- }
nclick="copycode($('code0'));">復制代碼