TISKBAF
  • 🖥️Linux OS
    • Useful Linux commands
    • To get a list of the dependencies of a package
    • Reset a Forgotten Root Password
    • How to Kill a Port in Linux
    • How to Install/Reinstall Linux GRUB Menu
    • Concatenate mp4 files using FFmpeg
    • Command to stop mirroring screens
    • Command to Run when Trash Won’t Empty
    • Prey Configuration Command (via Terminal)
    • Prey Configuration Command (via Terminal)
  • 🖥️Windows OS
    • Custom Profile Badges
      • badge-maker
      • shields.io - static badges
    • How to kill a task via terminal on Windows
    • Find and terminate a Windows Process by Port
    • The Complete List of Command Prompt (CMD) Commands
    • youtube-dl Usage
    • WSA/Google Play Services Reference Information
    • Windows Update Blocker (Windows Services Blocker)
    • Windows 11 Shell commands with friendly names
    • Wifi not automatically connecting on start-up when Ethernet is connected
    • To install many APK files at once
    • To get Firefox to remember logged in accounts
    • Spicetify Commands
    • Speech Recognition Commands
    • Simpletask [Simple] Documentation
    • Sideload Apps in Windows Subsystem for Android from APK Files
    • SetUserFTA Utility
    • Screensaver not starting even though it is configured correctly
    • Run Keys Registry Location
    • Rainmeter Config Definitions
    • Pushover
    • Program Folder Locations
    • Add an exclusion to Windows Security (or just turn off real-time protection)
    • Reddit RSS Feeds
    • Portainer on Windows
    • PGP: Encrypt & sign emails in a few clicks
    • Permanently Remove OneDrive from Windows
    • IRC NickServ Commands (full list)
    • Convert a P12/PFX Certificate to a .CER
    • How to embed in HTML
    • Misc. Windows Information
    • Issues with missing icons in Windows
    • Information on ‘scoop’ package manager for Windows
    • DISMTools Docs
    • Creating Python Virtual Environment in Windows and Linux
    • Using XnConvert to bulk convert image sizes
    • How to Merge Multiple Text Files using different methods in Windows
    • How to use OLLAMA_ORIGINS in Windows
    • To permanently turn off Windows Security and Windows Defender1
    • Enabling the disabled sounds in Windows
    • Enable classic right-click context menu on Windows 11
    • How to Convert Kindle Books (.awz/.awz3) to Other E-book Formats
    • How to Create Symbolic Links with mklink
    • APIMyLlama Commands
  • 🏬[Graphic] Design
    • Create a Realistic Shadow for Objects in GIMP (video)
    • How to Add Outer Glow Effects in GIMP
    • How to Curve Text In GIMP
    • Rounded corners in GIMP (video)
    • WORD CLOUD TEXT PORTRAIT EFFECT IN PHOTOSHOP (video)
    • BROKEN 3D TEXT EFFECT | PHOTOSHOP (video)
    • Type on a path in Photoshop
    • Nudify Guide (Stable Diffusion)
  • 💻Coding & Developing
    • APIMyLlama V2
      • APIMyLlama Source: Github
    • Insert Back button on a webpage
    • How to have a web page refresh automatically
    • AstroPaper Blog Theme
      • How to configure AstroPaper theme - Blog
      • Adding new posts in AstroPaper theme
    • How to generate Django SECRET_KEY
  • 📒Everything else
    • RSS Feed in your Notion Pages
    • 12 Firefox Hidden Settings You Should Check Out
    • ADB (almost) Full Commands List
    • How to pair your Wear OS smartwatch with a new phone
    • How to reset Cync by GE smart lights
    • IRC Servers & Channels Info
    • Internxt CLI commands and usage
    • Call Forwarding on mobile device
    • Obsidian Templater plugin
    • Exportify Documentation
    • KLLOQUE K10 B Ball Lock User Manual
    • How to delete bloatware from Android device
Powered by GitBook
On this page
  • Quick Steps
  • Method1
  • Using Command Prompt
  • Method2
  • Using PowerShell
  • Method3
  • Using Notepad
  1. Windows OS

How to Merge Multiple Text Files using different methods in Windows

PreviousUsing XnConvert to bulk convert image sizesNextHow to use OLLAMA_ORIGINS in Windows

Last updated 5 months ago

If you want to merge multiple text *(.txt) files into a single new file in Windows 10 or 11, you can easily do so in Command Prompt using the "copy" command. You can also merge text files using PowerShell commands, or by copying and pasting in Notepad. Before you get started, place all the files that need to be joined into a single folder.

Quick Steps

  1. Open the folder containing the files you want to combine.

  2. Hold down Shift and right-click in the folder.

  3. Click Open command window here or Open Terminal here.

  4. If using Terminal, click the down-arrow and select Command Prompt.

  5. Type copy *.txt newfile.txt and press Enter to merge.

Method1

Using Command Prompt

  • Right-click the Start button and select File Explorer. The 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, 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 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 the option isn't available in Windows 10, right-click the taskbar at the bottom of the screen and select Taskbar settings. Toggle off the option that says "Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key + x", then try again.

Type copy *.txt newfile.txt at the prompt and press ↵ Enter. This command combines all files ending in .txt into a single file called newfile.txt. You can replace newfile.txt with the name of the file you want to create (e.g., mergedfiles.txt).

  • Once you've verified that your output file looks how you'd like, you can delete the files you no longer need.

Method2

Using PowerShell

Right-click the Start button and select File Explorer. If you prefer using PowerShell to Command Prompt, merging text files into one is similar, but the commands are slightly different.

  • 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, copy them to a single folder first.

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 PowerShell window here…. This opens a new PowerShell window to the directory that contains your text files.

Run the command Get-Content file1.txt, file2.txt | Set-Content newfile.txt. Replace file1.txt, etc., with the file names you want to merge. You can also replace newfile.txt with the name you want to give to the final merged file.

  • If you want to merge all text files in the current directory into a single text file, use the command Get-Content *.txt .

Method3

Using Notepad

Open the text files in Notepad. If you just want to combine 2 or 3 text files into a single text file, you can do it easily with Notepad.

  • Open Notepad by typing notepad into the Windows search bar and clicking Notepad.

  • Click File > Open, select the first text file, then click Open.

  • Repeat for other text files you want to combine.

Create a new blank text file in Notepad. If you're using Windows 11, go to File > New tab to create the file in a new tab. On Windows 10, just open another new instance of Notepad.

Copy the text from the first file you want to combine. An easy way to do this is to click anywhere in the text, press Ctrl + A on the keyboard to select all, then press Ctrl + C to copy.

Paste the copied text into the blank text file. In your new blank Notepad file, click anywhere in the file, then press Ctrl + V to paste the copied text.

Repeat for the other files you want to combine. Go to your next text file, press Ctrl + A to select all, then press Ctrl + C to copy. In your new blank file, click where you want to paste the copied text, then press Ctrl + V to paste.

Save your file. In the new file that contains your merged text, go to File > Save as, give the file a name, and click Save.

If you're using Windows 11 and don't see the option to open the command window, select Open in Terminal instead. Then, once the is open, click the down-arrow at the top of the window and select Command Prompt.

If you just want to combine two or more text files into a single file but not all text files in the directory, use the command copy file1.txt+file2.txt+file3.txt newfile.txt. Replace file1, etc., with the names of the files you want to combine.

🖥️
Terminal
[1]
Start menu
text files