如何通过VB脚本更改文本文件中的单词(如unix中的sed)
答案 0 :(得分:1)
您可以使用FileSystemObject对象。一些说明:
Set fs = CreateObject("Scripting.FileSystemObject")
sf = "C:\Docs\In.txt"
Set f = fs.OpenTextFile(sf, 1) ''1=for reading
s = f.ReadAll
s = Replace(s, "Bird", "Cat")
f.Close
Set f = fs.OpenTextFile(sf, 2) ''2=ForWriting
f.Write s
f.Close
答案 1 :(得分:0)
以下步骤:(解决计算问题时,分而治之!)
在Google的帮助下,您应该能够搜索并发现如何实现以上所有要点。