Categories

TXT File Merger

Merge multiple text files with various strategies (concatenate, interleave, etc.)

Click to upload files or drag and drop files here

Maximum file size: 50MB Maximum files: 5
Supported formats: text/plain, text/html, text/css, text/javascript, application/json, .txt, .md, .log, .csv

Key Facts

Category
Data Processing
Input Types
file, select
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The TXT File Merger is a versatile utility designed to combine multiple text-based files into a single document using various strategic layouts. Whether you need to concatenate logs, interleave data lines, or add custom separators, this tool streamlines your text management workflow without requiring complex software.

When to Use

  • Consolidating multiple log files into a single chronological report.
  • Merging fragmented data exports into one unified dataset for analysis.
  • Combining several code snippets or documentation files into a master document.

How It Works

  • Upload your text files (TXT, MD, CSV, etc.) using the file selector.
  • Select your preferred merge strategy, such as concatenation or interleaving.
  • Configure optional settings like custom separators, file headers, or line numbering.
  • Process the files and download your newly combined text document.

Use Cases

Aggregating daily server logs into a single weekly analysis file.
Merging multiple Markdown documentation files into one comprehensive manual.
Combining fragmented CSV data exports into a single master file for spreadsheet import.

Examples

1. Consolidating Server Logs

System Administrator
Background
I have five separate daily log files that I need to review as a single continuous stream.
Problem
Manually copying and pasting content from five files is tedious and prone to error.
How to Use
Upload the 5 log files, select 'Concatenate' as the strategy, and set the separator to 'New Line'.
Example Config
mergeStrategy: concatenate, separator: newline, includeHeaders: no
Outcome
A single, unified log file containing all entries in chronological order.

2. Merging Documentation Chapters

Technical Writer
Background
I have written my project documentation in separate Markdown files for each chapter.
Problem
I need to combine these chapters into one document while keeping track of where each chapter starts.
How to Use
Upload the chapter files, select 'Block' strategy, and enable 'Include File Headers'.
Example Config
mergeStrategy: block, separator: double-newline, includeHeaders: yes
Outcome
A single Markdown file where each chapter is clearly labeled with its original filename.

Try with Samples

json, csv, html

Related Hubs

FAQ

What file types are supported?

The tool supports plain text formats including .txt, .md, .log, .csv, .html, .css, .js, and .json.

Can I add a separator between files?

Yes, you can choose between a single newline, double newline, or define a custom separator string.

Is there a limit to the number of files I can merge?

You can upload up to 5 files at a time for a single merge operation.

Does the tool preserve file encoding?

Yes, you can specify the output encoding, including UTF-8, ASCII, Latin-1, or UTF-16 LE.

Can I identify which content came from which file?

Yes, by enabling the 'Include File Headers' option, the tool will prepend the original filename to each section.

API Documentation

Request Endpoint

POST /en/api/tools/txt-merger

Request Parameters

Parameter Name Type Required Description
txtFiles file (Upload required) Yes -
mergeStrategy select Yes -
separator select Yes -
includeHeaders select Yes -
lineNumbers select Yes -
encoding select Yes -

File type parameters need to be uploaded first via POST /upload/txt-merger to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-txt-merger": {
      "name": "txt-merger",
      "description": "Merge multiple text files with various strategies (concatenate, interleave, etc.)",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=txt-merger",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]