msdav
asked on
Append files using VB6
My VB6 program reads one source text file and distributes its records to a number of output text files. The amount and count totals for each output file are computed during this distribution process.
The totals need to be included in batch header records and the files appended together thus. : Batch header record + file + batch header record + file etc.
Can this be done with VB6 code without having to read and write individual records from one file to another?
Is there a Windows command that the program can call that will append one text file to another?
The totals need to be included in batch header records and the files appended together thus. : Batch header record + file + batch header record + file etc.
Can this be done with VB6 code without having to read and write individual records from one file to another?
Is there a Windows command that the program can call that will append one text file to another?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
damion69 answers allows for both file copy and insertion of batch header record information as the "treg" variable - interesting solution!
example:
shell "copy " & file + file + file outputfile
The only other way that I know of is to read the contents of each file into variables, then write the entire thing out into your output file.