Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Append the contents of one text file to the end of another text file.  (Read 54459 times)

0 Members and 1 Guest are viewing this topic.

Tim_C

    Topic Starter


    Greenhorn

    How do I append the contents of one text file to the end of another text file?

    I have two text files, A.txt and B.txt.  I want to append the contents of B.txt to the end of A.txt.

    NOTE:  I have search the word "append" but apparently there is a APPEND command some how similar to the PATH command.   This is not what I am looking for.


    Microsoft Windows XP [Version 5.1.2600]

    Tim_C

      Topic Starter


      Greenhorn

      Also,

      Help files indicate the COPY command will append my files together with the "+" function.  I have had no success with this command either.

      COPY  A.txt + B.txt     A.txt
      COPY  A.txt    B.txt  + A.txt
      COPY  A.txt + B.txt

      Also, I am doing this in a batch file.  Perhaps this makes a difference.

      Tim C

      Tim_C

        Topic Starter


        Greenhorn

        New Information

        I have been able to perform the APPEND at the DOS command line but not within the batch file.


        Dusty



          Egghead

        • I could if she would, but she won't so I don't.
        • Thanked: 75
        • Experience: Beginner
        • OS: Windows XP
        TYPE B.TXT>>A.TXT  should append b.txt to a.txt (caps are for emphasis only)

        Copy a.txt+b.txt requires a new output file, a file cannot be copied onto itself.
        e.g. copy a.txt+b.txt c.txt   (c.txt would contain the appended files.)

        This is not a recognized use for the Append command, enter Append/? at the Command Prompt to check the syntax.

        Good luck
        One good deed is worth more than a year of good intentions.

        Tim_C

          Topic Starter


          Greenhorn

          Dusty,

          Thank you.  The TYPE command works.

          Tim

          Dusty



            Egghead

          • I could if she would, but she won't so I don't.
          • Thanked: 75
          • Experience: Beginner
          • OS: Windows XP
          Thanks for coming back to report your success..  Another winner..

          One good deed is worth more than a year of good intentions.

          jdd

          • Guest
          Re: Append the contents of one text file to the end of another text file.
          « Reply #6 on: January 06, 2009, 09:11:42 AM »
          Would a perl script to combine multiple files work faster? I have to combine 4 files that are at least a gig into one file.

          Dias de verano

          • Guest
          Re: Append the contents of one text file to the end of another text file.
          « Reply #7 on: January 06, 2009, 03:39:58 PM »
          Would a perl script to combine multiple files work faster? I have to combine 4 files that are at least a gig into one file.

          I shouldn't think so. It's just a different way of manipulating the filesystem.