求vbs代码 把所有a.txt文件追加到b.txt文件后

来源:百度知道 编辑:UC知道 时间:2024/05/24 17:10:44
求vbs代码 把所有a.txt文件,删除回车产生的空白行,追加到b.txt文件后

Const ForReading = 1
Const ForAppending = 8
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fa = FSO.OpenTextFile("a.txt", ForReading)
Set fb = FSO.OpenTextFile("b.txt", ForAppending)
Do Until fa.AtEndOfStream
s = fa.ReadLine
If s <> "" Then fb.WriteLine s
Loop
fa.Close
fb.Close