通过VBS合并2个文本文件

合并C:/file1.txt与C:/file2.txt,并另存为C:/output.txt

示例代码:

 

Const ForReading = 1 Set fso = CreateObject( "Scripting.FileSystemObject" ) Set outputFile = fso.CreateTextFile( "C:/output.txt",true ) Set textFile = fso.OpenTextFile("C:/file1.txt", ForReading ) strText = textFile.ReadAll textFile.Close outputFile.WriteLine strText Set textFile = fso.OpenTextFile("C:/file2.txt", ForReading ) strText = textFile.ReadAll textFile.Close outputFile.WriteLine strText outputFile.Close

你可能感兴趣的:(c)