Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I merge .txt files within macro ? 1

Status
Not open for further replies.

keithb03

Programmer
Feb 1, 2005
10
US
I am creating 2 .txt files in an ebm. I have a report in abc.txt and screen prints of the data that was scraped to produce the report in xyz.txt. I would like to merge them together at the end of the macro. Can MS-DOS statements be coded within the ebm to do this? Does ebm have a feature that will do this? Any other suggestions?

Thanks, Keith
 
What do you mean merge them? If you just want to put xyz.txt at the bottom of abc.txt, then you can use the input and print statements to accomplish this. If you want to "Match" data it will be more difficult.

Please provide more information for a more detailed solution.

calculus
 
calculus, thanks for the reply. Yes, I only want to put xyz.txt at the end of abc.txt so the analyst only needs to print 1 file.

Keith
 
Open c:/...abc.txt for append as #1
open c:/...xyx.txt for input as #2

Do While EOF(2) <> True
Input #2, Raw
Write #1, Raw
Loop

Close

This will loop through every line of xyz and write it to the end of abc.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top