This article describes how to use HeSoft Doc Batch Tool to delete matched keywords in multiple TXT text files at once using regex wildcards. The example takes deleting all numbers in English materials as a case, first showing multiple TXT files and their contents before processing, then explaining how to import files, choose the find-and-replace function, enable fuzzy formula text search, enter \d+ and leave the replacement content blank, ultimately achieving batch cleanup of numbers, numbering, statistics, and other repetitive content, reducing the workload of manually opening and editing files one by one.
When organizing large volumes of text materials, you often encounter a problem that seems simple but is very time-consuming: many TXT files contain the same type of content that does not need to be retained, such as numbers, identifiers, version numbers, page numbers, fixed keywords, and regularly patterned markers. If you open files one by one, then use an editor to find, delete, and save, not only are the repetitive operations numerous, but it is also easy to miss deletions or delete incorrectly. This article addresses this type of batch text cleanup problem: using the batch find and replace capabilities in office software, combined with wildcards or regular expressions, to delete keywords from many text files in one go.
Below, using HeSoft Doc Batch Tool as an example, we demonstrate how to delete all numbers from multiple txt text files. The matching rule used in the example is \d+, which can match consecutive digits; leaving the replacement content empty means deleting the matched content. This method is also suitable for batch processing of plain text files such as logs, materials, collected texts, and documentation.
Applicable Scenarios: Which Text Content is Suitable for Batch Deletion Using Wildcard Regex
The advantage of wildcards and regular expressions lies in their ability to describe a category of content, rather than being limited to a single fixed word. For example, if you want to delete all numbers, inputting "1, 2, 3..." one by one is obviously impractical; using \d+ can match consecutive numbers like "10", "30", "100", "26000" in one go. This approach is particularly efficient when dealing with multiple text files.
Common applicable scenarios include: batch deleting number identifiers in txt files; batch cleaning page numbers, statistical figures, and serial numbers from articles; batch deleting timestamps or fixed-format fields in log files; batch removing advertising keywords from collected texts; batch replacing sensitive words across multiple text files; and batch cleaning duplicate markers in content from documents like doc, docx, and txt. The screenshots in this article demonstrate TXT text, but the concept holds reference value for many document cleanup scenarios.
Effect Preview: Before Processing, Multiple TXT Files Contain Content Needing Deletion
Before processing, the folder contains several text files that need unified cleanup, including big_bang.txt, black_holes.txt, dark_energy.txt, dark_matter.txt, and galaxies.txt. When the number of such files increases, manual processing becomes very inefficient.

Opening one of them, black_holes.txt, reveals that the main text contains many numbers, such as "10" and "30". These numbers might be sample data, statistical information, or unwanted keywords. If each file had to be opened and manually deleted from, it would not only be time-consuming but also difficult to ensure consistent processing rules across all files.

Post-Processing Effect: Matched Numeric Keywords are Batch Deleted
After the processing is complete, opening the same black_holes.txt again shows that the positions originally containing numbers have been cleared. The green highlighted areas in the screenshot show the empty spaces after deletion, for example, the original "10 times" becomes " times", and the original "30 kilometers" becomes " kilometers". This indicates that the numbers matched by the regex wildcard rule have been replaced with empty content.

Note that after deleting the numbers, the spaces, punctuation, or semantics in the original text may require secondary cleanup based on actual business needs. For instance, "about 5 to 100 solar masses" would become "about to solar masses" after number deletion. If the goal is solely to clear the numbers, this result meets expectations; if you also need to remove the resulting extra spaces, a more refined expression or a subsequent whitespace treatment can be designed.
Operating Steps: Using Office Software to Batch Delete Keywords in TXT Files
Step One: Enter the Text Tool and Select Find and Replace Keywords in Text
Open HeSoft Doc Batch Tool . In the left tool category, select "Text Tool", then find and click "Find and Replace Keywords in Text" in the function list. The purpose of this function is to batch find specified keywords in text file content and replace them with new text; when the replacement content is empty, it can achieve batch deletion of keywords.

The purpose of this step is to enter a workflow specifically designed for finding and replacing text content. Unlike a regular editor that can only process the single currently open file, a batch processing tool allows adding multiple files into one task and executing the same rules uniformly, thus reducing repetitive labor.
Step Two: Add or Import the TXT Files to be Processed
After entering the function page, you can see buttons like "Add File", "Import Files from Folder", "Clear", and "More" at the top of the interface. In the example, 5 txt files have been added to the processing list, with the table displaying information such as file name, path, extension, creation time, and modification time.

If the files to be processed are concentrated in the same directory, you can use "Import Files from Folder"; if you are only processing a few specific files, you can also use "Add File". After importing, it is recommended to check the file names and paths in the list to confirm nothing is missing and no unnecessary files have been added by mistake. Once confirmed, click "Next" at the bottom of the page.
Step Three: Select Formula Fuzzy Search for Text, Enter the Regex Wildcard Rule
On the "Set Processing Options" page, select "Use Formula Fuzzy Search for Text" under "Search Method". This option is selected in the screenshot. This mode is suitable for using rules to match a category of text, rather than only matching exact, fixed strings.

In the "Keyword List to Find" on the left, enter \d+. Here, \d represents a digit character, and + means matching one or more consecutive digits. Therefore, it can match digit fragments like "5", "10", "100", "26000". The "Replacement Keyword List" on the right should remain empty. The interface also prompts "Leave blank to indicate deletion", so not entering any replacement content here signifies that the found numbers will be directly deleted.
If your goal is not to delete numbers, but a fixed word, you can also enter that word in the keyword list to find. If you want to delete a certain type of regular content, you can rewrite the expression according to the rules. Before actual operation, it is recommended to test with a few files first to confirm that the expression's matching range meets expectations.
Step Four: Set the Save Location and Start Processing
After completing the keyword options settings, continue by clicking "Next" to enter "Set Save Location". The interface flow shows subsequent steps including "Set Save Location" and "Start Processing". The choice of save location is very important: if you wish to keep the original files, it is recommended to choose a new output directory; if you are sure you want to directly update the original files, you need to back them up in advance to avoid irrecoverable data loss from mistaken deletion.
After confirming the save location, enter the "Start Processing" step to execute the batch task. Once processing is complete, go to the output location and open the result files for spot-checking, focusing on whether positions that originally contained numbers have been cleared, and whether file encoding, line breaks, and paragraph structure remain normal. In the example, black_holes.txt no longer contains the original numeric keywords after processing, indicating the batch deletion rule took effect.
FAQ and Notes
1. Why leave the replacement keywords blank
The goal of this example is to delete content, not replace it with other text. The software interface's right side "Replacement Keyword List" prompts "Leave blank to indicate deletion", so leaving it empty is correct. If other characters are entered, the software will replace the matched content with those characters.
2. Will \d+ delete all numbers
In common regex rules, \d+ will match consecutive numbers, so years, quantities, identifiers, distances, statistical values, etc., in the text might all be deleted. Before execution, confirm whether all these numbers are indeed unwanted. If you only want to delete numbers in specific positions or formats, a more precise matching rule is needed.
3. Is a backup needed before batch processing
Backup is recommended. Batch processing is highly efficient, but if rules are not set properly, erroneous results can be rapidly applied across multiple files. Especially when the deletion operation is irreversible, it's best to first copy the original files or output to a new directory, and only replace the official files after spot-checking confirms correctness.
4. Can it process doc, docx, or other document types
The screenshots in this article demonstrate TXT text files. For Word documents, docx, doc, and other formats, you should select the appropriate function based on the corresponding document tools or supported range within the software. Before processing different formats, it is recommended to check the function's description and test with sample documents first.
Summary: Use Batch Find and Replace to Reduce Repetitive Text Cleanup Work
Using HeSoft Doc Batch Tool 's "Find and Replace Keywords in Text" function, you can transform the work of opening each file, finding, and deleting one by one into a single import, unified rule setting, and batch execution. For users who need to clean up numbers, identifiers, keywords, or patterned text from a large number of txt files, wildcard regular expressions can significantly improve processing efficiency and ensure consistent cleanup standards across multiple files.
If you are currently organizing a batch of text materials, it is recommended to prepare a few test files first, input the matching rules as per the steps in this article, leave the replacement content blank, and only process the entire folder after confirming the results are correct. This way, you can leverage the efficiency advantages of batch office software while reducing the risk of accidental deletion.