PC Review


Reply
Thread Tools Rate Thread

combine multiple files into single file

 
 
=?Utf-8?B?QnJ1Y2VT?=
Guest
Posts: n/a
 
      25th Feb 2005
Hi, guys!

Running A2K, need to copy multiple text files to a single, new text file.
FileCopy assumes that the destination is a folder if wildcards are used for
the source, so I get an "Invalid Path" error when running the following code:

Dim fs
set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\*.txt", "C:\CombinedFile.txt"

Can anyone help with another way to do this?

Thanks,
BruceS


 
Reply With Quote
 
 
 
 
John Nurick
Guest
Posts: n/a
 
      25th Feb 2005
Hi Bruce,

Something like

shell("CMD.EXE /C COPY F1.txt + F2.txt + F3.txt new.txt")

On Fri, 25 Feb 2005 13:51:03 -0800, BruceS
<(E-Mail Removed)> wrote:

>Hi, guys!
>
>Running A2K, need to copy multiple text files to a single, new text file.
>FileCopy assumes that the destination is a folder if wildcards are used for
>the source, so I get an "Invalid Path" error when running the following code:
>
>Dim fs
>set fs = CreateObject("Scripting.FileSystemObject")
>fs.CopyFile "C:\*.txt", "C:\CombinedFile.txt"
>
>Can anyone help with another way to do this?
>
>Thanks,
>BruceS
>


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Reply With Quote
 
=?Utf-8?B?QnJ1Y2VT?=
Guest
Posts: n/a
 
      26th Feb 2005
John,
Thanks for help! Took me a couple of tries to get the syntax correct when
using variables for the names, but did get it to work. (Had to manually add
quotes [Chr(34)] around the file names because they contained embedded
spaces. Apostrophes won't work there.)
BruceS

"John Nurick" wrote:

> Hi Bruce,
>
> Something like
>
> shell("CMD.EXE /C COPY F1.txt + F2.txt + F3.txt new.txt")
>
> On Fri, 25 Feb 2005 13:51:03 -0800, BruceS
> <(E-Mail Removed)> wrote:
>
> >Hi, guys!
> >
> >Running A2K, need to copy multiple text files to a single, new text file.
> >FileCopy assumes that the destination is a folder if wildcards are used for
> >the source, so I get an "Invalid Path" error when running the following code:
> >
> >Dim fs
> >set fs = CreateObject("Scripting.FileSystemObject")
> >fs.CopyFile "C:\*.txt", "C:\CombinedFile.txt"
> >
> >Can anyone help with another way to do this?
> >
> >Thanks,
> >BruceS
> >

>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you combine multiple csv files into one file? Brian Wenner Microsoft Excel Worksheet Functions 14 21st Mar 2012 07:00 AM
combine information from multiple file into many different files. RW Microsoft Excel Worksheet Functions 2 8th Jun 2008 06:33 PM
Combine multiple VCF files into one VCF file ©® Freeware 0 27th Jun 2006 04:15 PM
multiple single tiff files into a single multiple pages file.. genc ymeri Microsoft C# .NET 0 23rd May 2006 07:41 PM
combine jpeg files as a single file with windows xp? Aaron Epstein Windows XP Photos 2 6th May 2004 05:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:28 PM.