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

Darren D darrend at nimble.com.au
Tue Jul 31 22:22:21 CDT 2007


Hi Gustav et al

The COPY /B worked

Donald the Type >> line is excellent - I can see a use for this already

Many thanks to those who responded

The final syntax was...

COPY /B Header.txt + *.xml + Footer.txt MyAyCoolAndWayBig.XML

Thanks

DD
-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk] 
Sent: Tuesday, 31 July 2007 7:59 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Kinda OT:A2003 Calling a batch file - merging files

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


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list