bat批量处理
把当前目录下所有TXT文件,在每个TXT文本内容里面 ,
把 ) 改成 )); 把GT改成GS; 直接修改不用生成新文本、
求高手帮忙 万分感激
以下代码复制到记事本,另存为VBS脚本,放在你要执行的文件夹里面。设置如下,注意红色部分。
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd /c dir /s /b *.txt > Temp.txt",vbHide
Wscript.Sleep 1000
sFile = "Temp.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = objFSO.OpenTextFile(sFile,1)
Do While Not oFile.AtEndOfStream
strLine = oFile.ReadLine
If Len(strLine) > 0 Then
Set File = objFSO.OpenTextFile(strLine, 1)
aryLines = File.ReadAll
File.Close
aryLines = Replace(aryLines, ")", "))")
aryLines = Replace(aryLines, "GT", "GS")
Set File = objFSO.OpenTextFile(strLine, 2)
File.Write aryLines
File.Close
End If
Loop
oFile.Close
objFSO.DeleteFile sFile
Set objFSO = Nothing
msgbox "Done!",64,"TXT"