Sub 替换()
Dim tmp As String
Dim file As String
file = Dir(ThisWorkbook.Path + "\*.sql")
Do While file <> ""
Open ThisWorkbook.Path + "\" + file For Binary As #1
str= String(LOF(1), vbNullChar)
Get #1, , str
tmp = Replace(str, "AND HOUR_ID BETWEEN 15 AND 18", "AND HOUR_ID BETWEEN 10 AND 10")
Close #1
Open ThisWorkbook.Path + "\" + file For Output As #1
Print #1, str
Close #1
file = Dir
Loop
End Sub
VBA批量替换TXT或.LOG文件内容
最新推荐文章于 2024-03-06 21:26:19 发布