[AccessD] Kinda OT:A2003 Calling a batch file - merging files

McGillivray, Don [IT] Donald.A.McGillivray at sprint.com
Mon Jul 30 11:27:07 CDT 2007


I've done something similar by redirecting the output of the DOS "type" command to a file.  I've never had an issue with extraneous characters using this method.  Something like this:

Type *.fil >> BigFile.txt  

This concatenates the contents of all files with the extension "fil" into a single file called BigFile.txt.  Don't know if the order of concatenation is predictable, if that's important to you.

As for inserting text between additions or at either end, I think you can redirect the DOS "echo" command in a similar way.  Something like:

Echo "Start of file" >> BigFile.txt
Type *.fil >> BigFile.txt
Echo "End of file" >> BigFile.txt

Hope this helps . . .


-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren D
Sent: Sunday, July 29, 2007 4:30 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Kinda OT:A2003 Calling a batch file - merging files

Hi all


I am calling a batch file from my access app


The batch file just 'merges' a few files into one big file and then gives it a


This is the batch file - Very basic - 1 liner - 


copy FirstFile.txt + C:\SomeFolder\*.xml + Secondfile.txt


Pretty basic - but the combining leaves a small ascii type square as the very
very last character - Like this --->


Anyone know how to stop this from happening?


Or even better - How to 'build' or merge a few files into one big file - from


Or even better still - How to insert Text eg Merge


"This is the start of the file" +  C:\SomeFolder\*.XML + "This is the end" into


Many thanks in advance




AccessD mailing list
AccessD at databaseadvisors.com
Website: http://www.databaseadvisors.com

More information about the AccessD mailing list