本帖最后由 pcl_test 于 2016-10-10 22:06 编辑
假设有“文本.txt”,内容为abcd
vbs- arr = array("a|举","b|个","c|栗","d|子")
- file = "文本.txt"
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set f = fso.OpenTextFile(file, 1)
- txt = f.ReadAll
- f.Close
- For Each a In arr
- t = split(a, "|")
- txt = replace(txt, t(0), t(1))
- Next
- Set f = fso.OpenTextFile(file, 2)
- f.Write txt
- msgbox "Done"
复制代码
|