Merge Multiple Text files into One Text File
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Merge Multiple Text files into One Text File
Does anyone know if it is possible to automate the process of merging three text files into one textfile each week? This will be a recurring process. For example, I need to submit a Positive Pay reconciliation to the bank each week in one text file. Currently I have 3 separate text files that consist of a Header, Details, and Trailer. This is a Fixed Width Text files that need to be combined. Can anyone help? Thanks.
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
1. Could make a macro using File/Open, then Edit/Insert/Files or FileName. then File/SaveAs. Would need to always have the same filenames for the macro to work.
2. Could create a batch file to append the files with Xcopy and call the batch file using Tools. Could use wildcards for filenames if different each week.
May need to add extra steps to remove lines with extra header/footers. That could be done on the final combined file with a RegEx
2. Could create a batch file to append the files with Xcopy and call the batch file using Tools. Could use wildcards for filenames if different each week.
May need to add extra steps to remove lines with extra header/footers. That could be done on the final combined file with a RegEx
Hope this was helpful.............good luck,
Bob
Bob
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
FYI
I actually went to expert exchange and received this answer to create a .bat file
@echo off
cls
set file1=BOAHeader.txt
set file2=BOADetails.txt
set file3=BOATrailer.txt
set dest=BOAPPOutput.txt
type %file1% > %dest%
type %file2% >> %dest%
type %file3% >> %dest%
I did this earlier. However, thanks again for your response.
@echo off
cls
set file1=BOAHeader.txt
set file2=BOADetails.txt
set file3=BOATrailer.txt
set dest=BOAPPOutput.txt
type %file1% > %dest%
type %file2% >> %dest%
type %file3% >> %dest%
I did this earlier. However, thanks again for your response.
Merge Multiple Text files into One Text File
Thank you, I will try that.