本帖最后由 batman 于 2011-5-29 18:33 编辑
第二问:- Dim fso, vbstr, vbout
- Set fso = CreateObject("scripting.filesystemobject")
- vbstr = fso.OpenTextFile("a.txt", 1).ReadAll()
- Dim str, stra
- If UBound(Split(vbstr, "</tabID>")) < 3 Then stra = "</tabID>"
- For i = 0 To UBound(Split(vbstr, "</tabID>"))
- If i = UBound(Split(vbstr, "</tabID>")) - 1 Then
- vbout = vbout & Split(vbstr, "</tabID>")(i) & "</tabID>"
- Else
- vbout = vbout & Split(vbstr, "</tabID>")(i) & stra
- End If
- Next
- fso.OpenTextFile("a.txt", 2, 1).Write vbout
- Set fso = Nothing
- MsgBox "ok"
复制代码 ps:昨天是老妈生日,所以没能及时回复。。。 |