How to Merge Text (.Txt) Files in Command Prompt
How to Merge Text (.Txt) Files in Command Prompt
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

Right-click the Start Windows Start button and select File Explorer. The Start menu is usually at the bottom-left corner of the screen.You'll want the files to be in the same folder to make things easier from the command prompt. If the files are scattered in multiple locations, make sure you copy them to a single folder first. 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.

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.

Press ⇧ Shift as you right-click a blank area of the right panel. A context menu will expand.

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.

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).

Press ↵ Enter to join the files. This creates a new file with containing the contents of all text files in the current folder. Once you've verified that your output file looks how you'd like, you can delete the files you no longer need.

What's your reaction?

Comments

https://sharpss.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!