I receive 4 text files with data - all have the same specs (delimited)
I must merge all 4 into one main text file.
Currently I open each one, copy, and paste the data into the main text file.
Is there a way to automate this process? Macro, batch file? It is a real pain (and possible data integrity issue if all
data is not copied into the main one).
Thank you.
Michael
Merge 4 text files
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 574
- Joined: 10 Feb 2010, 17:32
Re: Merge 4 text files
Just data.
No header, footer, trailer.
Thanks HansV !
Michael
No header, footer, trailer.
Thanks HansV !
Michael
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Merge 4 text files
You could use a batch file with the following contents:
@echo off
cd c:\textfiles
copy oldfile.txt+file1.txt+file2.txt+file3.txt+file4.txt newfile.txt
del oldfile.txt
ren newfile.txt oldfile.txt
This merges file1.txt ... file4.txt into oldfile.txt in a folder c:\textfiles.
Make a backup copy before trying it!
@echo off
cd c:\textfiles
copy oldfile.txt+file1.txt+file2.txt+file3.txt+file4.txt newfile.txt
del oldfile.txt
ren newfile.txt oldfile.txt
This merges file1.txt ... file4.txt into oldfile.txt in a folder c:\textfiles.
Make a backup copy before trying it!
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 574
- Joined: 10 Feb 2010, 17:32
Re: Merge 4 text files
Now I can't wait to go to work tomorrow and try it!
Thanks a million Hans !!
Michael
Thanks a million Hans !!
Michael