Excel Batch Generate TXT Files Tutorial: Create Multiple Notepad Files by Row or Merge into a Single Text File


Translation:EnglishFrançaisDeutschEspañol日本語한국어
Update Time:2026-11-26 06:28:56
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide

When you need to create a notice, certificate, label, or other TXT Notepad file for each row of data in an Excel spreadsheet, copying and pasting one by one is both time-consuming and error-prone. This article explains how to use the "Batch generate text files from Excel" feature in office software to map spreadsheet columns to TXT template placeholders, generate multiple TXT files in one batch, and also merge all data into a single text file, with notes on data tables, text templates, file naming, and output checking.

When an Excel worksheet contains dozens, hundreds, or even more rows of data with the same structure, and each record needs to be formatted into a TXT file using a fixed layout, manually copying, replacing, and saving files creates a large amount of repetitive work. For example, generating award notifications from a personnel list, creating text lists from order details, outputting customer information as separate data files, or consolidating all records from a table into one TXT file are all common batch document processing needs.

This article uses an award information table as an example to introduce how to use the office software HeSoft Doc Batch Tool to automatically fill names, awards, event names, and dates from Excel, xlsx, or xls data tables into a TXT template. Users can either generate a separate text file for each Excel row or choose to combine all rows into a single TXT file, thereby reducing the workload of copying and pasting row by row, modifying content, and naming files.

1. Scenarios Suitable for Batch TXT Generation from Excel

The core logic of this feature is that Excel provides the data and TXT provides the layout. Each row in Excel represents one record, and each column represents a replaceable field. The TXT template stores the fixed text and uses placeholder text to mark the positions that need dynamic filling. During processing, the office software reads the table data, replaces the placeholders in the template with the corresponding cell contents, and then outputs text files in batches according to the settings.

Common use cases include:

  • Batch generation of notification files: Create a separate TXT notification for each employee or customer based on name, department, date, and matter.
  • Batch creation of award or certificate information: Fill personnel, awards, event names, and award dates into a unified text format.
  • Batch output of orders, logistics, or equipment records: Generate a separate text file for each order, device, or project, making it easier to archive and transfer.
  • Converting Excel data to Notepad files: Convert the required fields from xlsx or xls tables into lighter, more compatible plain-text TXT files.
  • Merging into summary text: When there is no need to split files, all Excel data rows can be written continuously into a single TXT file using the same template.

Unlike directly copying an entire table, the template approach preserves natural language structure. For example, the table only needs to store original fields such as "name, award, event, and date," while the complete congratulatory message and description text are written uniformly in the template. Later, even if the fixed text needs to be changed, only the template needs to be adjusted once, without editing each result individually.

2. Preview of Results: Excel Data and TXT Template Before Processing

1. How to Prepare the Excel Data Table

The example worksheet is named Students. The first row contains field headers, including Name, Award, Event, AwardDate, and Avatar. Starting from the second row, each row corresponds to one person's complete record. For example, the Name column stores names, the Award column stores awards, the Event column stores event names, and the AwardDate column stores dates.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

When organizing data, it is recommended to place the headers close to the main data and ensure that the header names have clear meanings. The table can contain columns that are not involved in this text replacement, such as the Avatar image column shown in the screenshot. Columns without corresponding TXT placeholders can be left unmapped and will not affect the processing of other text fields.

2. How to Prepare the TXT Template

Before processing, a TXT template also needs to be prepared. The example template contains the fixed title " Award Recognition " and congratulatory text, with [Name], [Award], [Event], and [AwardDate] written at the positions that need to change. These bracketed contents are only the placeholder notation used in this example, and their purpose is to let the software know which parts of the template should be replaced by Excel cell data.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

The fixed text, punctuation, blank lines, and line breaks in the template form the basic format of the generated files. Therefore, before batch processing, it is best to confirm that the text content and line break positions are correct. Placeholders should also use complete strings that are unlikely to duplicate ordinary body text, and it should be ensured that the same field can be accurately matched among Excel column names, mapping settings, and template text.

3. Resulting TXT Files After Processing

1. Generate a Separate TXT File for Each Excel Row

After selecting "Generate a file for each Excel row," the software reads the table row by row and creates multiple TXT files in batches. From the processing results, it can be seen that the output directory now contains files such as Amelia Scott.txt, Benjamin Clark.txt, Chloe Anderson.txt, Grace Collins.txt, and Oliver Hayes.txt. Each personnel record has a corresponding Notepad document, making it easier to find, send, or categorize by person.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

This output method is especially suitable for business scenarios involving one file per person, one file per order, or one file per item. In the example results, names are used as file names, so there is no need to manually rename each file after generation, and it is also easy to see which Excel record each TXT file corresponds to.

2. Placeholders Are Automatically Replaced with Table Content

After opening Benjamin Clark.txt, you can see that [Name] in the template has been replaced with Benjamin Clark, [Award] with Gold Award, [Event] with Annual Sports Challenge, and [AwardDate] with 2026-11-19. The original title, congratulatory text, line breaks, and punctuation in the template are still retained.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

This shows that the final result is not simply a direct copy of an entire Excel row into a TXT file, but rather field filling based on the pre-designed text template. As long as the table headers, placeholders, and mapping relationships are set correctly, the same format can be repeatedly applied to large amounts of data.

4. Operation Steps: Batch Generate Text Files from Excel

Step 1: Open the "Batch Generate Text Files from Excel" Feature

Open HeSoft Doc Batch Tool , go to "Text Tools" in the left feature category, and then find "Batch Generate Text Files from Excel". The description of this feature is to use each row of Excel data to fill a text template and generate files in batches, which suits the current need to convert Excel to TXT and batch-create Notepad files.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

After entering the tool, the page guides you through several stages: "Select records to process", "Set processing options", "Set save location", and "Start processing". Setting them in order helps avoid missing the template, data source, or output location.

Step 2: Add the TXT Template to Be Filled

In the "Select records to process" stage, click "Add File" to add the prepared TXT template to the task list. If the template is stored in a folder, you can also use "Import Files from Folder" as appropriate. In the example, template.txt is added, and the list displays information such as file name, path, and extension.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

The purpose of this step is to specify the text structure to be used during batch generation. After adding the file, check the file path and extension to confirm that the correct version of the template has been imported. If the wrong file was selected, remove it from the list first and then add it again. After confirming it is correct, click "Next" to proceed to the Excel data table and mapping settings.

Step 3: Select the Excel File, Worksheet, and Header Row

On the "Set processing options" page, first import the Excel data table through "Select File". After the software reads the workbook, select the worksheet that actually contains the data; in this example, Students is selected. Then set "Header row number (the row closest to the main data)". In the example, the header is in the first row, so enter 1.

image-Excel batch generate TXT,Excel to Notepad,table data generate text files,batch create TXT files,Excel merge into one TXT

The header row setting is very important because the software needs to identify columns such as Name, Award, Event, and AwardDate through this row. If the header row number is entered incorrectly, the column names may not be displayed correctly, and the correct template replacement relationships cannot be established later. The page also provides an option to "Process only visible data rows"; if the table has been filtered or has hidden rows and you only want to process the currently visible records, you can decide whether to enable it based on the actual task.

Step 4: Establish the Mapping Between Excel Columns and Template Placeholders

After Excel is read successfully, the page lists the column names in the data table. Next, fill in the text in the template that should be replaced on the right side. The mapping relationships in this example are as follows:

  • The Name column corresponds to [Name] in the template;
  • The Award column corresponds to [Award] in the template;
  • The Event column corresponds to [Event] in the template;
  • The AwardDate column corresponds to [AwardDate] in the template.

The Avatar column is not used in the TXT template, so its corresponding input box can remain empty. Doing so will not delete that column from Excel; it only means that this field is not read when generating text this time. The "Find and Replace" function on the page can help verify the template text. When setting it up, pay special attention to Chinese and English parentheses, spaces, and letter case to avoid characters that look similar but are actually different.

The role of the mapping relationship can be understood as follows: the software finds [Name] in the template and replaces it with the content of the Name column in the current data row; when processing the next row, it continues to use the same rule but fills in the next row's name. Other fields are replaced row by row in the same way.

Step 5: Choose Whether to Generate Multiple TXT Files or Merge Them into One TXT File

In the "Set the number of generated files" area, choose the output method according to your purpose. The screenshot provides two modes:

  1. Generate a file for each Excel row: For each valid data row in the table, a corresponding separate text file is generated. This is suitable for notifications, personal profiles, orders, label content, and other scenarios that need to be saved separately.
  2. Merge all rows into one file: Each row of data is still replaced according to the template, but the results are written into the same TXT file. This is suitable for creating summary lists, batch records, imported data, or continuous text lists.

In this example, to obtain multiple Notepad files distinguished by name, select "Generate a file for each Excel row". If you need to merge them into one TXT file, switch to "Merge all rows into one file". Before choosing the merge mode, it is recommended to arrange line breaks or separator text between records in the template so that the content of different data rows does not become difficult to distinguish after being connected.

Step 6: Set File Naming and Save Location

Continue downward or proceed to the next stage, and set the naming basis and save location for the output files according to the options provided on the page. In the example results, data from the Name column is used as the file name, so files such as Benjamin Clark.txt and Grace Collins.txt are generated. In actual operation, it is recommended to choose a field that is unique, short, and easy to identify as the naming basis.

If the naming field is exactly the same for different data rows, files with the same name may be generated. Therefore, check the Excel data before processing, and if necessary combine information such as serial numbers, names, or dates to ensure that the names are sufficiently distinct. Also avoid using special characters that are not allowed by the operating system in file name data. The save location should preferably be a newly created empty folder so that the quantity and content can be checked uniformly after processing and old results are not mixed in.

Step 7: Start Batch Processing and Check the Results

After all settings are completed, enter the "Start processing" stage. Before execution, check again the template file, Excel worksheet, header row number, field mappings, output method, and save directory. After processing begins, the software automatically traverses the Excel data and generates TXT files, without requiring manual row-by-row copying and saving.

After the task is completed, open the output folder, first compare whether the number of generated files matches the number of valid Excel data rows, and then randomly open several TXT files to check whether the names, awards, event names, and dates have been replaced correctly. If the merge mode is selected, focus on checking whether all records have been written into the same file and whether the line breaks and separators between different records meet expectations.

5. Frequently Asked Questions and Notes

1. Why was [Name] in the template not replaced?

First check whether the characters in the mapping input box are exactly the same as those in the template. For example, [Name] and 【Name】 use different brackets, and an extra space after [Name] may also be treated as different text. At the same time, confirm that the Name column has been correctly identified and that the header row number is not set to the main data or a blank row.

2. What if the Excel header is not in the first row?

If there are explanatory text, merged headers, or blank rows before the worksheet data, set the "Header row number" to the row closest to the main data that actually contains field names, rather than always entering 1. The correct header row should contain column names such as Name and Award used to establish the mapping relationships.

3. If the table contains an image column, can it be directly filled into TXT?

TXT is a plain-text format. In the example, Avatar is image content, while this task only maps text columns, so that column remains blank. If you only need to generate text notifications, there is no need to delete the image column; just ignore it. Do not treat image cells directly as ordinary text placeholders.

4. Why does the date format differ from what was expected?

The generated text is usually based on the displayed or underlying content read from the Excel cell. To keep dates consistent, it is recommended to unify the format of the AwardDate column before processing and check whether there is a mixture of text dates, datetime values, and plain numeric dates. Testing with a small amount of data first can help detect formatting issues more quickly.

5. When should the results be merged into one TXT file?

If the files later need to be sent individually, archived separately, or read by other systems one by one, choose to generate one file per row. If the goal is to create a complete list, a continuous report, or a unified text import, choose to merge all rows into one file. Both methods use the same set of Excel data and template mappings; the main difference is the number of output files.

6. Why is it recommended to test before formal processing?

Batch tasks generate a large number of files at once. If the template contains typos, field mapping errors, or duplicate file name data, the problems will also be magnified in the batch. It is recommended to first copy three to five rows of data for testing, confirm that the content, line breaks, dates, and file names are all correct, and then process the complete worksheet.

6. Summary

With the "Batch Generate Text Files from Excel" feature, xlsx and xls tables can be used as structured data sources, TXT files as fixed text templates, and field mapping relationships to complete automatic replacement. Whether batch-creating multiple TXT Notepad files from each Excel row or merging all data into one text file, there is no need to open the template, copy content, and save files one by one.

For users who often process notifications, lists, orders, data cards, or text inventories, this type of batch processing in office software can significantly reduce repetitive operations while lowering the probability of missing fields, incorrect entries, and file naming errors. In actual use, it is recommended to first organize the Excel headers and data formats, prepare a TXT template with clear placeholders, and then follow the steps in this article to complete template import, worksheet selection, field mapping, output method, and save location settings. Run a small test first, and after confirming that the results are correct, begin the full batch processing.

Keyword:Excel batch generate TXT , Excel to Notepad , table data generate text files , batch create TXT files , Excel merge into one TXT
Creation Time:2026-11-26 06:28:39
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.