This wikiHow teaches you how to combine multiple text files into a single new file using the Windows command prompt. The simplest way to do this is to place all of the files that need to be joined into a single folder and then run the joining command from that folder.

Steps

  1. 1

    Make sure all of your text files end with a blank line (or the dividing text of your choice) to make it clear where each section begins.

  2. 2
    Open the folder in which the text files are saved. Start by opening the This PC or Computer directory in the right panel, and then browse to the folder where you've saved your files. Once you open the folder, you should see your text files in the right panel.
    Advertisement
  3. 3
    Press Shift as you right-click a blank area of the right panel. A context menu will expand.
  4. 4
    Click Open command window here. This opens a command prompt window that's already set to the current directory.
    • If you enabled Windows PowerShell, you'll have to click Open PowerShell window here instead.
  5. 5
    Type copy *.txt newfile.txt at the prompt. Replace newfile.txt with the name of the file you want to create (e.g., mergedfiles.txt).
  6. 6
    Press Enter to join the files. This creates a new file with containing the contents of all text files in the current folder.[1]
    • Once you've verified that your output file looks how you'd like, you can delete the files you no longer need.
  7. Advertisement

Community Q&A

  • Question
    Why am I getting extra copies of every file?
    Matt McCombs
    Matt McCombs
    Community Answer
    You may have your output set to the same file type as your inputs.This would cause the program to read the output file after its initial creation and add in copies of the previously merged documents.
  • Question
    I have merged text files into one, but the prompt included the files in random order. Can it also merge files in an ordered fashion?
    Community Answer
    Community Answer
    If you have three files, A.TXT, B.TXT and C.TXT and you want to combine them in the order CAB in the file CAB.TXT, you can use the copy command as follows: copy C.TXT+A.TXT+B.TXT CAB.TXT.
  • Question
    How do I separate the content of text files from one another?
    Community Answer
    Community Answer
    You can take the text from the other ones, cut them and paste them into another text editing program, or you could just leave it alone and let them stay.
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 692,137 times.
How helpful is this?
Co-authors: 12
Updated: October 2, 2019
Views: 692,137
Categories: Command Prompt
Article SummaryX

1. Open File Explorer.
2. Open the folder that contains the text files.
3. Press Shift and right-click in the folder.
4. Click Open command window here.
5. Type copy *.txt newfile.txt.
6. Press Enter.

Did this summary help you?
Advertisement