Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combine all text file in directory into one file.
Hello,
I am trying to adapt the following code posted by Jim Rech. Sub a() Dim SrcFiles, CurrSrc As String Dim DestFile As String, Counter As Integer Dim TextLine As String SrcFiles = Array("c:\File1.txt", "c:\File2.txt") Open "c:\file3.txt" For Output As #1 For Counter = 0 To UBound(SrcFiles) Open SrcFiles(Counter) For Input As #2 Do While Not EOF(2) Line Input #2, TextLine Print #1, TextLine Loop Close #2 Next Close #1 End Sub I need to do the following. I need to combine all the text files in directory "C:\ECPJM" into one text file called "Combined.txt". Any help would be greatly appreciated. Thanks, Rich |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file save error: the file or directory cannot be created | Excel Discussion (Misc queries) | |||
Excel should let me sort the file directory when saving a file | Excel Discussion (Misc queries) | |||
How to get file name from long directory | Excel Programming | |||
backing up file in directory | Excel Programming | |||
get path - save new file - same sub-directory as existing file | Excel Programming |