Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenate two text file (A97)

    Is it possible to combine two text files using VBA in A97? I was hoping to use some variation of the FileCopy command, using a "+" operator to name the two source files, like what (IIRC) was supported in DOS many years ago. I am trying to avoid reading the files line-by-line simply to combine their contents.

    TIA
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Concatenate two text file (A97)

    You can use Shell to issue a DOS command:

    <code>Shell "cmd /c copy ""C:SourceFile 1.txt""+""C:SourceFile 2.txt"" ""C:TargetFile 3.txt"""</code>

    The extra quotes are only required if the path or file name contains spaces.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •