How to merge multiple text files with vbscript
This article mainly introduces "how to merge multiple text files with vbscript". In the daily operation, I believe that many people have doubts about how to merge multiple text files with vbscript. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to merge multiple text files with vbscript". Next, please follow the editor to study!
The code is as follows:
Const ForReading = 1 Set objFSO = CreateObject ("Scripting.FileSystemObject") Set objOutputFile = objFSO.CreateTextFile ("output.txt") Set objTextFile = objFSO.OpenTextFile ("c:\ logs\ file1.log", ForReading) strText = objTextFile.ReadAll objTextFile.Close objOutputFile.WriteLine strText Set objTextFile = objFSO.OpenTextFile ("c:\ logs\ file2.log", ForReading) strText = objTextFile.ReadAll objTextFile.Close objOutputFile.WriteLine strText objOutputFile.Close this ends the study of "how to merge multiple text files with vbscript" I hope I can solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!