How to merge multiple text files into one notepad file
To merge text files in Windows without third-party tools: use copy *.txt output.txt in Command Prompt; specify order with copy /b file1.txt file2.txt output.txt; use PowerShell’s Get-Content *.txt | Out-File for UTF8 and spacing; or create a reusable merge.bat script.

If you need to combine several text files into a single Notepad document, Windows provides built-in command-line tools that accomplish this without third-party software. Here are the methods to achieve this task:
The operating environment of this tutorial: Windows 11 Pro, Windows 11
1. Use the copy command in Command Prompt
This method concatenates all specified .txt files in sequence and writes them into a new file using the built-in copy command. It preserves original line endings and requires no external dependencies.
- Open Command Prompt as administrator or standard user
- Navigate to the folder containing the text files using cd
- Type copy *.txt merged_output.txt and press Enter
- Confirm the output file appears in the same directory
2. Concatenate specific files with explicit order
When file order matters—such as combining README.txt before CONTENT.txt—this approach gives precise control over sequence by listing each filename individually.
- Open Command Prompt and go to the target folder
- Enter copy /b file1.txt file2.txt file3.txt final.txt
- The /b flag ensures binary mode copying, preventing unintended EOF markers
- Verify the resulting file contains content from each source in listed order
3. Use PowerShell with Get-Content and Out-File
PowerShell offers greater flexibility for encoding handling and line separation. This method reads each file’s content, inserts blank lines between them, and saves the result with UTF8 encoding by default.
- Launch PowerShell
- Change to the directory with your text files using Set-Location
- Run Get-Content *.txt | Out-File -Encoding UTF8 merged.ps1.txt
- To add spacing between files, use Get-Content *.txt | ForEach-Object { $_; "" } | Out-File -Encoding UTF8 merged_spaced.txt
4. Create a batch script for repeated use
A reusable batch file automates merging across different folders without retyping commands. It accepts the output filename as an argument and processes all .txt files in the current location.
- Create a new text file named merge.bat in the target folder
- Add this content: @echo off copy /b *.txt %1
- Save and run it from Command Prompt with merge.bat combined.txt
- The script outputs combined.txt containing all source files
The above is the detailed content of How to merge multiple text files into one notepad file. For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undress AI Tool
Undress images for free
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undresser.AI Undress
AI-powered app for creating realistic nude photos
ArtGPT
AI image generator for creative art from text prompts.
Stock Market GPT
AI powered investment research for smarter decisions
Hot Article
Popular tool
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
20606
7
13699
4




