Many office documents, log texts, and collected content often contain mixed-in numbers, values, page numbers, or temporary numeric markers. If these contents are scattered across multiple TXT files, manual deletion can be very inefficient. This article, combined with interface screenshots from HeSoft Doc Batch Tool , introduces how to use the "Find and Replace Keywords in Text" feature in text tools, batch import TXT files, select formula fuzzy search, and use the regular expression \d+ to match consecutive numbers, leaving the replacement content empty, thereby quickly completing numeric cleanup across multiple text files.
When organizing text data, the most troublesome part is often not the complexity of a single file's content, but the need to repeat the same cleaning actions across many files. For example, a project folder may contain multiple TXT documents, each filled with numerical sequences, statistical values, years, distances, quantities, or other temporary markers. You might only want to keep the textual descriptions and remove all numerical content, but opening each file individually to manually find and delete them is not only inefficient but also prone to omissions.
This article centers on the topic of "using wildcard regular expressions to batch delete keywords in many text files" and demonstrates how to complete batch cleaning using the office software HeSoft Doc Batch Tool . In the example, we need to process multiple TXT files and delete all consecutive digits within them. The operational logic is simple: add the multiple TXT files to the processing list, select the Find and Replace function, enable formula-based fuzzy search in the find mode, enter the regular expression \d+, and leave the keyword list for replacement empty. Since the interface indicates "leaving it blank means deletion," the matched digits will be uniformly replaced with nothing.
This method is suitable for office users looking to reduce repetitive tasks. Whether you are cleaning a data repository, processing English texts, organizing logs, standardizing copywriting, or pre-cleaning a batch of TXT files before publication, as long as the content to be deleted follows a pattern, you can consider using regular expressions to complete it in batch.
Applicable Scenarios: Why Use Wildcard Regex to Batch Remove Text Numbers
Regular find and replace is suitable for handling fixed content, such as replacing a specific word in all files with another. However, in real office work, much of the content to be deleted is not fixed. For instance, File A contains "10," File B contains "30," and File C contains "26000." These numbers are different but belong to the same category of content. Entering each number individually for a search would be very cumbersome.
The advantage of wildcards or regular expressions is that they do not only match a specific text string but rather a category of text that follows a pattern. The \d+ used in this article is a typical example; it can represent "one or more consecutive digits." Therefore, any string of digits appearing in the text can be found uniformly.
The following scenarios are particularly well-suited for this method:
- Batch removal of numbering: For example, removing serial numbers, IDs, chapter numbers, or system-generated numbers interspersed in materials to obtain cleaner body text.
- Batch deletion of numerical values: For example, when popular science articles, experiment records, or log descriptions contain a large number of digits, and only the textual description needs to be kept, they can be cleaned up uniformly.
- Batch processing of collected text: TXT content exported from web pages, systems, or databases often carries digital identifiers, making manual cleanup costly.
- Batch desensitization: When certain texts contain codes, quantities, location numbers, or internal markers that should not be disclosed, they can be deleted first by rule.
- Unified text formatting: When the structure of multiple text files is inconsistent, you can first delete a certain type of interfering content before proceeding with further organization.
It should be noted that this article demonstrates the batch processing of TXT text files. If your files are Word documents like doc or docx, or formats like PDF or HTML, you should select the corresponding tool based on the software's corresponding category. The screenshot on the left shows "Text Tools" is selected, so this article focuses on batch finding, replacing, and deleting in TXT plain text.
Effect Preview: Multiple TXT Files in the Folder Before Processing
Before processing, multiple TXT files can be seen in the folder, including big_bang.txt, black_holes.txt, dark_energy.txt, dark_matter.txt, and galaxies.txt. These files have different names but all belong to the same batch of text data that needs cleaning.

When the number of files reaches a certain quantity, opening and editing each one manually is no longer efficient. More importantly, manual operation makes it difficult to ensure consistent rules: some numbers might be deleted while others are missed; some files might be saved while others are forgotten. The value of a batch processing tool lies in unifying these repetitive steps into a single workflow.
Opening one of the sample files, black_holes.txt, reveals that the body text contains multiple digits, such as "10" and "30" appearing in descriptions of black hole mass, radius, and distance. The screenshot uses red boxes and arrows to mark some of these digits, indicating they are the target for deletion this time.

The key point here is: the content to be deleted is not just the fixed values of "10" or "30," but all digits. If other files contain values like "5," "100," "4," or "26000," they should be deleted as well. Therefore, we need to use a search rule that can generalize this category of content, rather than fixed keywords.
Effect Preview: Numbers in Text Replaced with Nothing After Processing
After completing the batch processing, checking black_holes.txt again shows that the original numerical content has disappeared. The positions where numbers were are now blank, while the rest of the English text remains. This indicates that the search rule successfully matched the consecutive digits in the text and performed the deletion by "replacing with nothing."

From the post-processing effect, it can be seen that regular expression batch deletion does not only act on one currently opened file but executes the same rule on multiple text files based on the import list. That is to say, as long as a TXT file previously added to the processing list contains content matching \d+, it will be processed uniformly.
This result is very useful for office scenarios. For example, you have a batch of instruction documents and need to delete all numbers from them before handing them over to later personnel for proofreading; or you have a group of log texts and need to remove dynamic numbering before conducting keyword analysis; or you are preparing public materials and need to batch clean internal numerical values. Completing it in batch through a single setup is far more efficient than manual editing.
Operation Steps: Batch Find and Delete Numerical Keywords in TXT Files
The following explains the setup sequence based on the software operation screenshots. The overall process can be divided into four stages: selecting the function, importing files, setting up regex find and replace with nothing, and saving and starting the process.
Step 1: Find the Find and Replace Function in Text Tools
After opening HeSoft Doc Batch Tool , select "Text Tools" in the left navigation bar. On the page, you can see multiple text-related functions, with the first one being "Find and Replace Keywords in Text," whose function description is to batch find and replace keywords in the content of text files.

The function to select here is precisely this one. Although its name includes "Replace," when the replacement content is empty, it can also be used for deletion. Therefore, if you want to batch delete keywords, serial numbers, digits, or other matching content in multiple TXT files, you don't need to look for a separate "Delete Keywords" button; the Find and Replace function can achieve this.
After selecting the function, the software will enter a task-based operation page. The step bar at the top shows the processing flow, including "Select records to be processed," "Set processing options," "Set save location," and "Start processing." This type of flow is suitable for batch file processing because each step has a clear purpose, reducing the probability of misoperation.
Step 2: Import the Text Files to be Batch Processed
On the "Find and Replace Keywords in Text" page, the first step is to add files. Buttons like "Add File," "Import Files from Folder," "Clear," and "More" can be seen at the top right of the interface. If only a few files need processing, click "Add File"; if the target files are all in the same directory, using "Import Files from Folder" is more convenient.

The screenshot shows 5 records have been imported, and the list displays the file name, path, extension, creation time, and modification time. It can be seen that these files are all TXT extensions, located in the same test directory. The bottom of the list also shows a record count of 5, making it convenient for users to confirm how many files are included in the current batch task.
The operational purpose of this step is to include all TXT files that need to have numerical keywords cleaned into the same processing task. The expected result is: the file list is complete, the extensions are correct, and no files that shouldn't be processed are mixed in. If a certain file is found that shouldn't participate, it can be removed via the operation column on the right side of the list; if files are imported incorrectly, you can also use "Clear" and re-add them.
After confirming the files are correct, click "Next" at the bottom to enter the processing options setup.
Step 3: Enable Formula-Based Fuzzy Search, Prepare to Use Regular Expressions
On the "Set Keyword Options" page, the first step is to select the search method. The interface has two options: "Precise Text Search" and "Fuzzy Formula Search." Since this article aims to match all consecutive digits rather than a specific fixed number, "Fuzzy Formula Search" needs to be selected.

Once this option is selected, matching rules similar to regular expressions can be entered in the keyword list. For tasks involving the batch removal of non-fixed content like serial numbers, digits, or IDs, fuzzy formula search is more suitable than precise search. Precise search is better for tasks like "find a specific word and replace it"; fuzzy formula search is more appropriate for tasks like "find a category of content that matches a certain pattern."
The screenshot also offers the "Ignore letter case" option. Since this example handles digits, this option won't affect the result; if you are processing English text keywords, such as matching words in different cases simultaneously, you can check it as needed.
Step 4: Enter \d+ in the Find List, Keep the Replacement List Empty
Enter \d+ in the "List of keywords to find" on the left. This expression is used to match one or more consecutive digits. For instance, "3," "10," "30," "100," and "26000" in the text can all be recognized by it as matching content.
Then, look at the "Replacement keyword list" on the right. The screenshot shows this area is empty, with a prompt stating, "leaving it blank means deletion." Therefore, there is no need to enter any replacement text on the right for this example; keeping it blank is sufficient. This way, during processing, the software will replace the matched digits with empty content, effectively deleting them.
The expected result for this step is: the find rule on the left is filled with \d+, the replacement content on the right is empty, and the search mode is set to fuzzy formula search. The combination of these three elements forms the complete rule for "batch deleting all consecutive digits."
If your actual task is to delete other keywords, the approach is similar: enter the fixed word or rule to find on the left, and leave the right side empty to delete; if it's not deletion but replacement, enter the new content on the right.
Step 5: Set the Save Location to Avoid Overwriting Original Files
After completing the keyword settings, continue by clicking "Next." According to the page flow at the top, the subsequent step requires setting the save location. When batch processing files, it is recommended to save the output results to a new directory, especially when using regular expressions for the first time.
The reason is simple: the matching scope of a regular expression might be broader than you imagine. If the original files are overwritten directly, recovery costs are high if a rule is written incorrectly. By saving to a new folder, you can check the pre- and post-processing files side-by-side at any time. After confirming correctness, decide whether to replace the files in the original directory.
In office document processing workflows, retaining the original file is a good habit. Whether it's TXT text, or potentially doc, docx, PDF, and other documents processed later, as long as batch content modification is involved, it's advisable to first back up or output to a new location.
Step 6: Start Processing and Check Results
After setting the save location, enter the "Start Processing" stage. Once executed, the software will process the text files one by one according to the file list and delete the matched numerical keywords based on your set rules. After processing is complete, it is advisable to open one or two files for a spot check, focusing on whether the digits are deleted, whether the body text is still intact, and whether the paragraph structure meets expectations.
In the example of this article, the original digits in the processed black_holes.txt have disappeared, indicating the \d+ rule is effective. If you find that some digits were not deleted, the rule might not have covered certain special formats; if you find the deletion scope was too large, you need to go back to the backup file, adjust the expression, and process again.
Common Questions and Precautions
1. What is the difference between using Fuzzy Formula Search and Precise Search?
Precise search is suitable for finding fixed text, such as finding the exact phrase "black holes." Fuzzy formula search is suitable for finding content with a common pattern, such as all digits, certain serial numbers, or a type of code. The numerical content to be deleted in this article is not fixed, so Fuzzy Formula Search is chosen.
2. Why does leaving the replacement list empty result in deletion?
The essence of find and replace is to swap found content with new content. When the new content is empty, the original content is replaced with an empty string, which means it is deleted. The right-side area in the screenshot also explicitly prompts "leaving it blank means deletion," so this is a valid usage supported by the function.
3. Will deleting numbers affect the English or Chinese body text?
If only \d+ is used, it usually only matches consecutive digits and will not delete ordinary English words or Chinese characters. However, spaces, punctuation, and units around the numbers will remain, so excess whitespace might appear after processing. Whether to further clean up the whitespace depends on your document requirements. If you are very sensitive to formatting, you can delete the digits first, then separately check or process the whitespace.
4. Can I batch delete keywords with multiple different rules?
Judging by the interface, the left side contains the "List of keywords to find" and the right side the "Replacement keyword list," indicating the function supports managing keywords in list form. During actual use, you can fill in the content to find and replace according to the software's rules. If the goal is deletion, leaving the replacement item empty is sufficient. However, when adding multiple rules, you should test with a small number of files first to ensure each rule meets expectations.
5. Is it necessary to back up before processing?
Backing up is strongly recommended. The advantage of batch processing is speed, but the risk is that one setup can affect multiple files. Especially when using regular expressions, the more flexible the rule, the more careful verification is needed. Keeping the original file allows you to quickly recover if the results are unsatisfactory.
6. Can this method process docx or doc documents?
The example in this article is based on TXT file processing in Text Tools. Word documents (doc, docx) belong to a different file format with an internal structure distinct from plain text. If you want to batch process Word documents, you should select the Word-related tools in the software and refer to the corresponding function description. Do not directly apply the TXT processing method to all formats.
Summary: Accomplish Multi-file Text Cleaning with One Rule Setup
The most important aspect of batch deleting numbers, serial numbers, or keywords from multiple TXT text files is identifying the pattern of the content and selecting a suitable batch processing tool. In the example of this article, HeSoft Doc Batch Tool uses its "Find and Replace Keywords in Text" function to transform the operations of finding, deleting, and saving—which would otherwise need to be done file by file—into a single batch task.
In actual operation, simply enter Text Tools, select the Find and Replace function, import multiple TXT files, choose "Fuzzy Formula Search" in the processing options, enter \d+, and leave the replacement keyword list empty to batch delete the consecutive digits in the files. For users who frequently organize text data, clean log content, remove numbering, or standardize document content, this method can significantly reduce repetitive labor and improve file processing efficiency.
It is recommended that you first copy the original files or save the processing results to a new directory before formal processing. After confirming the effect is correct, you can then use the batch-cleaned text for subsequent editing, archiving, publication, or analysis. This way, you can enjoy the efficiency gains brought by the batch processing of office software while ensuring the safety and reliability of important files.