When a folder contains many TXT files that need to have numbers, numbering, or fixed-format keywords cleaned up uniformly, opening and editing them one by one is very inefficient. This article, combined with the HeSoft Doc Batch Tool screenshot, explains how to access the find and replace function from a text tool, import multiple txt files, choose to use formula fuzzy text search in the processing options, enter \d+ to match consecutive numbers, and leave the replaced keyword list blank, thereby enabling batch deletion of numeric keywords in text content.
Many office scenarios are not complex, but they are particularly time-consuming. For example, a folder may contain dozens or even hundreds of TXT files, all mixed with unwanted numbers, serial numbers, or statistical values. You could, of course, use a text editor to open each file one by one and perform find-and-delete operations, but as the number of files grows, the repetitive work quickly multiplies, and it's hard to ensure every file is processed according to the same rules. This article introduces a method better suited for batch office tasks: using HeSoft Doc Batch Tool to batch delete keywords from multiple TXT files using wildcard regular expressions.
The goal of the example in this article is to delete all numbers from the text. The processing rule uses \d+, which can match consecutive digits; the replacement content is left empty, meaning the matched content will be deleted. This workflow is suitable for scenarios like text data cleaning, batch de-numbering, batch deletion of statistics, and batch organizing of collected texts.
Applicable Scenario: Multiple TXT Files in a Folder Need Unified Keyword Deletion
If you are only processing one file, the find-and-replace function of an ordinary editor is sufficient. But when the processing target becomes a whole folder, the difference in efficiency becomes very noticeable. In the screenshot, the files to be processed include big_bang.txt, black_holes.txt, dark_energy.txt, dark_matter.txt, and galaxies.txt, all being the same batch of text materials. Their content structures are similar, and all might contain numbers or keywords that need a unified cleanup.
This batch processing method is suitable for the following needs: batch deleting numbers from multiple txt files; batch cleaning serial numbers from English materials; batch deleting fixed-format content from log files; batch removing page numbers, sequence numbers, or statistic values from materials; batch replacing or deleting a specific sensitive word; and executing the same set of cleanup rules uniformly across multiple text documents. Compared to manual editing, the batch processing function of office software is better suited for repetitive, rule-defined file organization tasks.
Effect Preview: Issues with Files and Content Before Processing
Before processing, multiple txt text files can be seen in the folder. They are all objects to be processed. If you open, check, and modify them one by one, a large number of repetitive operations will occur.

After opening black_holes.txt, you can see there are many numbers in the main text, such as "10" and "30". These numbers are highlighted in the screenshot, indicating they are the target content to be deleted this time. Deleting them manually from one article might not seem difficult; but if the same rule needs to be applied to multiple files, a batch tool would be more stable.

Post-Processing Effect: Number Keywords Replaced with Empty
After executing the batch find-and-replace, viewing the same file again shows the original numbers have been deleted. The green positions in the screenshot display the text gaps left after deletion. For example, the positions where the numbers originally were no longer show content like "10" or "30", indicating the matching rule has taken effect on the text.

A key point to understand here is: what is called "batch keyword deletion" is essentially "batch find and replace with empty". When the software finds content matching the rule, if the replacement keyword field is left empty, the found content will be removed. This method can delete fixed words as well as a category of text that matches a rule.
Operation Steps: From Importing Files to Setting Up Regular Deletion Rules
Step 1: Open the Find and Replace Function in the Text Tool
After launching HeSoft Doc Batch Tool , select "Text Tool" in the left navigation bar. In the function list, click "Find and Replace Text Keywords". From the interface description, it's clear this function is for batch finding and replacing keywords in text file content, which is very suitable for tasks like this article's goal of uniformly cleaning up multiple TXT files.

The expected outcome of this step is to enter the batch find-and-replace workflow. Selecting the correct function is very important, as the processing target here is text content, not file names, folder names, or file format conversions.
Step 2: Add Files to be Processed to the Task List
After entering the function page, the first step is "Select records to process". The top right corner of the page offers "Add File" and "Import Files from Folder". If all txt files are in the same directory, importing from a folder is more convenient; if you only need to process a few files, you can add them manually.

In the example, 5 files have already been imported, and the list shows information such as serial number, name, path, extension, creation time, and modification time. After importing, it is recommended to check two things: first, whether the number of files is correct (the screenshot summary shows 5 records); second, whether the path points to the directory you want to process (for example, the example path is located at D:\test). After confirming it's correct, click "Next" below.
Step 3: Select Using Formulas to Fuzzily Find Text
Upon entering "Set Processing Options", select "Use formulas to fuzzily find text" in the "Search Mode" area. In the screenshot, this option is highlighted with a red box and is selected. The value of this mode lies in the ability to use rules similar to regular expressions to match text, rather than just finding an exact fixed string.

If you select "Precise text search", it is more suitable for deleting completely identical words, such as deleting all instances of the term "test version"; this example, however, requires the deletion of various numbers of different lengths and content, making fuzzy matching via formulas more suitable.
Step 4: Input \d+ and Leave the Replacement Content Empty
In the "List of keywords to find" on the left, input \d+. This expression can match one or more consecutive digits. For instance, it will identify "4", "10", "100", and "26000" as content to be processed.
Do not fill in any content in the "List of keywords to replace with" on the right. The interface clearly prompts "Leaving blank means deletion", so leaving it empty equals deletion. After completing the settings, continue by clicking "Next", enter the save location settings, and then start processing according to the interface flow.
If you need to delete multiple rules, you can fill them in separately according to the software list's input method. To avoid false matches, it is recommended to test with a small folder first, confirm the deletion result is correct, and then batch execute on the official data.
Common Questions and Notes
1. Why do blanks appear mid-sentence after processing?
Because this example only deletes the numbers themselves, not the spaces or units before or after the numbers. For example, deleting from "10 times" will leave " times". This is a normal result. If you wish to process the extra spaces together, you need to design a further matching rule, or perform a blank space cleanup after the number deletion is complete.
2. Will the wildcard regex mistakenly delete numbers that need to be kept?
It's possible. The matching range of \d+ is very broad, any consecutive digits could be deleted, including years, distances, quantities, and serial numbers. Therefore, before formal processing, you must confirm that all these numbers fall within the scope of deletion. For important files, it's recommended to back them up first or output to a new location.
3. Can I delete only a specific number?
If you only want to delete a specific fixed number, you can use a more specific search term rather than \d+. For example, if you only want to delete "2026", just search for "2026". If you want to delete a certain format of serial number, you need to write a more precise expression based on the numbering pattern.
4. Is this method suitable for Word documents?
This article demonstrates processing for TXT text files. For Word documents like doc or docx, you should use the corresponding Word tool in the software, or a function that supports document content processing. Different file formats have different structures, so it is recommended to test with a copy first before processing.
Summary: Enhancing Text Cleaning Efficiency with Batch Office Tools
Batch deleting keywords from text files is essentially handing a large volume of repetitive find, replace, and save operations over to the software. HeSoft Doc Batch Tool provides a workflow of batch file importing, rule-based searching, and replacing with empty for deletion, suited for processing numbers, serial numbers, and patterned content in multiple TXT files.
If you frequently organize text materials, collected content, log files, or batch documents, it's recommended to use this article's workflow as a basic template: first import files, then select "Use formulas to fuzzily find text", enter the matching rule, leave the replacement content empty, and finally set the save location and execute. This can significantly reduce repetitive work and ensure uniform processing results across batch files.