Append multiple text files to create a new file

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I am trying to append three text files to create a new file.

Is there a function similar to the DOS Command copy which allows this
functionality?

As an example

Copy File1+File2+file3 Newfile.

Please advise
 
How is this a Microsoft Access question? I don't recall seeing a need or a
way to "append ... files to create a new file" in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
In a way it is not a direct MS Access question, however, MS Access is
generating the original text file which is being sent via FTP to a
datacentre. Now a Header and trail record is required within the original
file... Just to make it more complex the additional records are not of the
same format as the original file. So my initial thought was to create two
additional files and append them to the original one.

However, if there is an alternative. I would be interested in hearing it.
 
Ken

Sorry, I don't have enough experience doing what you've described to be of
help. Perhaps one of the other newsgroup readers can offer their insight...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
You can write data one record at a time to an existing text file using the
Open statement to open an existing text file for appending. But that is not
a direct way of appending existing text files.

I wrote an EXCEL macro (VBA) a few years back that would allow the combining
of various text files into a new text file -- it essentially opened each
text file and wrote the data to a new, single text file one line at a time.
Worked very well. But I've never tried to modify it for ACCESS use.

If you're interested in the EXCEL macro, I could post that code.
 
Back
Top