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

Gustav Brock gustav at cactus.dk
Mon Jul 30 16:59:04 CDT 2007


Hi Darren

Try with COPY /B, that should remove the EOF byte.

/gustav

>>> martyconnelly at shaw.ca 30-07-07 20:19 >>>
Could be a couple of things, I haven't got an Ascii Table handy
Have a look at last char in HexEditor.
At a guess it could CTRL-Z which is an old DOS EOF

McGillivray, Don [IT] wrote:

>Darren,
>
>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 . . .
>
>Don
>
>-----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
>name
>
> 
>
>This is the batch file - Very basic - 1 liner - 
>
> 
>
>copy FirstFile.txt + C:\SomeFolder\*.xml + Secondfile.txt
>mynewcoolcombinedfile.XML
>
> 
>
>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
>VBA
>
> 
>
>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
>OneCoolFile.XML
>
> 
>
>Many thanks in advance
>
> 
>
>DD





More information about the AccessD mailing list