
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
,根本未执行到Temp.bat,效率比bagpipe的差,不过SET设置变量没有bagpipe的大CODE: [Copy to clipboard]在命令提示符下运行。若要写到脚本中,更改%i为%%i。对于文本中出现引号的情况没有做出错处理。for /f "delims=" %i in (源文件.txt) do @set /p "var=%i;" <nul >>目标文件.txt
CODE: [Copy to clipboard]set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("a.txt")
do while file.atendofstream<>true
s=s & file.readline & " ;"
loop
file.close
set file=fso.createtextfile("b.txt")
file.write left(s,len(s)-1)
file.close
msgbox "操作成功",4096
CODE: [Copy to clipboard]set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("b.txt")
s=file.readall
file.close
set file=fso.createtextfile("c.txt")
file.write replace(s,";",vbcrlf)
file.close
msgbox "还原成功",4096
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |