concatenating files

J

Jeff Ellison

VBA beginner.....Can anyone offer a script or suggestions
that takes multiple text files and combines them into one
single file. Thank you!
 
W

Wayne Morgan

The DOS copy command is capable of doing this and would probably be the easiest. You could
do it yourself in VBA by opening each file, reading it line by line, and outputting it to
another file that you keep open during the whole process. To use the DOS copy command, you
could use the Shell command in VBA.

Example:
Shell "command.com /c copy file1.txt+file2.txt+file3.txt Newfile.txt", vbHide
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top