Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • How to Fix High CPU and Disk Usage by wmpnetwk.exe Windows 10
  • How to Use Your Android Phone as a Hotspot Smartphones
  • 4 Time Management Tools That Will Save Your Sanity Cool Websites
  • How To Add a Hidden Area Inside An Encrypted VeraCrypt Volume Computer Tips
  • How to Recover a Facebook Account When You Can’t Log In How-To
  • 3 Best MicroSD Cards To Buy in 2020 Gadgets
  • Make a Custom Live Linux Distro with Linux Live Kit Linux Tips
  • Top 10 Collaboration Tools for Remote Teams Software Reviews

How to Combine or Merge Multiple Text Files

Posted on October 6, 2020 By blog_786 No Comments on How to Combine or Merge Multiple Text Files

There are several cases where you might need to combine multiple text files into one text file. For example, you can get a CD containing hundreds of text files in different directories, which you need to combine into one file for import to Excel, etc.

It is also useful if you have network log files, server log files, or backup logs that you want to combine for data mining or data analysis purposes. There are several different ways to combine text files, and the results may vary slightly depending on the method you choose.

In this article, I’ll write about several ways to combine text files, so if one method doesn’t work too well, you can try something else.

First method – command prompt

If you are ok with using the command line, then there are a few simple commands you can use to quickly merge an entire group of text files. The advantage of using the command line is that you don’t need to install any third party software. If you’d like a little tutorial on using the command line, check out my beginner’s guide to using the command line.

Also, since the command line can take multiple parameters, you can actually create a rather complex command to filter and sort the files that you want to include in the attach process. I’ll explain the simplest command, but I’ll also go through some examples to show you how to do more complex things.

First, open Windows Explorer and navigate to the directory where the text files are located. If the files are stored in many subfolders, change to the parent directory. Now press and hold CTRL + SHIFT and then right-click any empty space in the explorer window.

How to Combine or Merge Multiple Text Files

This will open up a command window that is already set to the directory you were in. Now all we have to do is enter the command. As you can see above, I have three text documents and a couple of folders in my folder. If I want to concatenate only text files in this one folder, I would run this command:

for% f in (* .txt) enter “% f” >> c: Test output.txt

In programming language, this is a simple FOR loop that loops through all files ending in .TXT and outputs them to a file called output.txt.

How to Combine or Merge Multiple Text Files

As you can see above, the loop simply runs a separate command for each text file it finds in the directory. Please note, if you have a text file, but it has a different extension like .log, .dat, etc., then you can simply change the value of * .txt in the command. It’s also worth noting that the output must not be in the current directory, otherwise the output file will be appended to itself, since it is also a text file.

Let’s say you have text files that are not only in one folder, but in many subfolders. In this case, we can add a parameter to the command that tells it to recursively search for text files in any subfolders of the current directory.

for / R% f in (* .txt) enter “% f” >> c: Test output.txt

You will notice the / R option just after the for statement. Now when I run the command, you will see that it finds a couple of additional text files in three directories under the same directory.

How to Combine or Merge Multiple Text Files

As usual on the command line, there is actually another command that allows you to do the same as the FOR statement above. Actually this command is much simpler and if it suits you you can use it instead of the above method.

copy * .txt output.txt

How to Combine or Merge Multiple Text Files

This command works well, but it has fewer parameters than the previous one. For example, it will prevent you from recursively searching through subfolders.

The second method – TXTCollector

TXTCollector is a free text file merger tool with a decent set of features. It is very easy to use and can be configured to work in several ways.

First, enter or copy and paste the path to the folder in the “Folder” field at the top, or just click the “Browse folders” button and select the folder with the text files. Then you can choose which type of files you want to combine.

By default TXTCollector will search all TXT files and merge them. However, you can choose from the list and merge or merge multiple CSV, BAT, HTM, LOG, REG, XML and INI files into one!

Select the Include subfolders checkbox if you want TXTCollector to recursively scan each subfolder of the main folder. TXTCollector will show you exactly how many files it found in the directory.

Then you can choose the separator to be displayed between each merged file. This is a nice feature that is not available on the command line. You can choose an option from the drop-down menu, or just type whatever you want in the box.

By default, the program places the directory name, file name and separator between each file. If you want to merge files continuously without gaps between each file, select the No Separator, No File Name, and No Carriage Return check boxes.

After that, you will have a choice: add a space between files or not. The great thing about TXTCollector is that you can actually customize it. If you click on the link at the bottom called Extensions and Separators, you can add your own extensions to TXTcollector.

Edit the extensions.txt file located in the TXTCollector application data directory. Note that TXTcollector only handles plain text files, no matter which extension is used. Hence, it cannot combine multiple XLS files, for example, if they are not saved as plain text.

The only limitation of the program is that it can simultaneously combine no more than 32,765 text files. If you have more, you can combine that number into one, and then combine the larger with more smaller ones, up to 32,765!

All in all, a very simple yet powerful free application for combining multiple text files. Hopefully these two methods will work for most people. If you are faced with a more difficult situation, feel free to leave comments and I will try to help.

Also, be sure to check out my other post on how to combine multiple PowerPoint presentations Enjoy!

–

Share this:

  • Twitter
  • Facebook
Free Software Downloads

Post navigation

Previous Post: Convert Windows Directory to HTML Listing
Next Post: How to Disable Adobe Flash in Microsoft Edge on Windows 10

Related Posts

  • How to Share Files Between PCs, Smartphones and Tablets Free Software Downloads
  • How to Extract Icons from EXE, DLL, OCX, and CPL Files Free Software Downloads
  • Convert a Windows PC into a Virtual Machine using Hyper-V Free Software Downloads
  • Best Free Alternative PDF Viewer to Adobe Reader Free Software Downloads
  • How do I open a JAR file in Windows? Free Software Downloads
  • Copy Large Files Over the Network Faster with TeraCopy Free Software Downloads

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • Six Copyscape Alternatives That you can use
  • How to Make Phone Calls Without Revealing Your True identity
  • 50 Useful Websites on the Internet You Didn’t Know Existed
  • Everything You Need to Know About WannaCry Ransomware Attack
  • Automatically Transcribe YouTube Video/Audio with Google Docs
DMCA.com Protection Status

Recent Posts

  • Six Copyscape Alternatives That you can use
  • 4 Different Ways to Test your Internet Speed
  • How to Make Phone Calls Without Revealing Your True identity
  • Use Secret Silver Subscription Plan to Save Money on Audible
  • Everything You Need to Know About WannaCry Ransomware Attack

Recent Comments

  1. 6 Things You Need Know About Email Encryption on Delete All Emails from Gmail With Once Click
  2. Looking For YouTube Alternative? Try These 7 Video Sharing Sites on Ten Best YouTube Video Editing Software 2023
  3. 8 (+1 New) Ways to Post on Instagram From Computer on How I Solved My Bluestacks Graphic Card Error (2 Ways)
  4. Find out what WordPress Theme and Plugin a Website is Using on How to Install a Theme on WordPress
  5. KeepVid Music: Use Online Music as your Personal Music Library on Top Ten Best iPad Music Apps
  • Best ti34 calculator 2020

    Best ti34 calculator 2020. 1 - Selected TI34II Scientific Explorer + By Texas Instruments Top Reviews Works fine and in

  • How to Enable Mac Firewall and Configure It OS X
  • Ten Best YouTube Video Editing Software 2023 How-To
  • Everything You Need To Know About SSD Wear & Tear Reviews
  • How to Update Xbox 360 without Internet or Xbox Live How-To
  • How To Root a Nexus 5, 5X, 6, 6P, & 7

    There are many advantages to rooting Nexus 5, 5X, 6, 6P, and 7 devices. Some of the benefits of rooting include gaining access to exclusive root-onl

  • What To Do If Windows 10 Action Center Won’t Open Windows 10
  • How To Google Translate a Web Page Computer Tips

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version