When multiple TXT files contain similar invalid content, advertising phrases, specific sentences, or paragraphs with certain fuzzy keywords, opening them one by one for manual deletion is not only time-consuming but also prone to omissions. This article, using the actual operation interface of the office software " HeSoft Doc Batch Tool ", explains how to batch-import TXT files, search for entire lines or paragraphs based on fuzzy keywords, and directly delete the corresponding text. The article will show before-and-after effects, applicable scenarios, detailed operation steps, and common precautions, helping you quickly complete TXT text cleaning, batch organization, and duplicate content removal, reducing repetitive work and improving file batch processing efficiency.
If you have a batch of txt Notepad files on hand, and certain paragraphs need to be deleted as long as they contain a certain type of keyword—such as year numbers, fixed sentences, explanatory text, advertising slogans, template residual content, etc.—manually opening and deleting them one by one usually involves a huge workload. Especially when the number of files is large, it is not only time-consuming but also prone to incorrect or missed deletions.
The problem this article aims to solve is: How to use office software to batch delete paragraphs or complete lines containing a fuzzy keyword in TXT files. Combined with HeSoft Doc Batch Tool in the screenshot, you can import multiple txt files at once, use fuzzy search rules, and directly batch delete content containing specified keywords. This is suitable for daily text cleaning, batch organizing, and content preprocessing scenarios.
Applicable Scenarios
This method is particularly suitable for the following office scenarios:
- Batch cleaning of collected txt texts: Delete content containing specified words, number patterns, or fixed phrases.
- Batch organizing of Notepad materials: Uniformly remove unnecessary explanatory paragraphs, annotation paragraphs, or template paragraphs.
- Batch deletion of invalid content in logs or exported texts: For example, complete lines containing certain marker words.
- Batch text preprocessing: Prepare for subsequent import into Word, doc, docx, Excel, or other systems by cleaning.
- Replacement for repetitive multi-file labor: Instead of opening and modifying txt files one by one, it is more suitable for processing dozens or even hundreds of files together.
Effect Preview
As can be seen from the screenshots, before processing, some complete paragraphs or lines in the txt text contained specified content, for example:
- Content containing number patterns, such as numeric fragments like 13.8;
- Content containing fixed phrases, such as In this sense.

The result after processing is: Any complete line matching these keyword rules is deleted, the corresponding paragraph disappears, and the text content becomes noticeably cleaner.

From the before-and-after comparison images, you can intuitively see:
- Before processing: The 1st and 5th paragraphs of the text contain the target keywords;
- After processing: These paragraphs containing the target keywords have been removed, leaving only the content that did not match.
This kind of effect is very suitable for tasks such as Batch deleting paragraphs containing keywords in TXT and Batch cleaning text in Notepad files.
Operation Steps
Step 1: Enter Text Tools and select the corresponding function
After opening the software, you can see multiple office processing modules in the left navigation bar. According to the screenshot, first enter Text Tools, then select the function card:
"Find and replace complete lines in text files based on keywords"
From the function name and interface prompts, it can be determined that this function supports locating entire lines based on keywords and replacing them with new text; if the replacement content is left empty, it means direct deletion. This is exactly the method needed for batch deleting paragraphs containing fuzzy keywords in txt files.

Operation Purpose: Enter the correct batch processing function page.
Expected Result: Open the file import interface for this function.
Step 2: Batch add the TXT files to be processed
After entering the function page, first come to the 1st step "Select records to be processed". In the upper right corner of the screenshot, you can see buttons:
- Add File
- Import Files from Folder
- Clear
If you have relatively few txt files, you can directly click Add File; if an entire folder of Notepad files needs processing, it is more suitable to use Import Files from Folder to load them all at once in batch.
After importing, the interface list will display information such as file name, path, extension, creation time, and modification time, making it easy to check the current text files to be processed.

Operation Purpose: Import all txt files that need content deletion uniformly into the software.
Expected Result: Multiple txt records are displayed in the file list. After confirming they are correct, click Next at the bottom.
Step 3: Set fuzzy keyword search rules
After entering the 2nd step "Set processing options", this is the core setting area for this batch processing task.

According to the screenshot, the software provides two search methods:
- Exact text search
- Fuzzy text search using formulas
Since the requirement of this article is to delete paragraphs containing a certain fuzzy keyword, you should select here:
Fuzzy text search using formulas
In the screenshot, two example rules have already been entered in the "List of keywords to search for":
- \d+
- In this sense
This shows that you can add the content to be matched into the list item by item:
- If you want to match a specific fixed phrase, you can enter the text directly;
- If you want to match a type of fuzzy content, you can use formulas or regular expressions.
For example, \d+ in the screenshot can be understood as matching numeric content; any entire line containing text matching this rule will be hit for processing.
Operation Purpose: Tell the software which content constitutes the targets that need to be deleted.
Expected Result: All keywords or fuzzy rules to be searched for have been added to the left-side list.
Step 4: Leave the replacement content empty to achieve the "delete" effect
On the right side of the same settings page, you can see the area:
List of replacement keywords
In the screenshot, there is a clear prompt next to it: Leaving blank means deletion.
This step is very critical. Because the current logic uses "Find and replace complete lines", therefore:
- Fill in the keywords or fuzzy rules to find on the left;
- If no replacement content is filled in on the right, it means the matched complete lines will be directly deleted.
That is to say, to achieve batch deletion of paragraphs containing fuzzy keywords in txt, you do not need to enter replacement text here; just keep it empty.
Operation Purpose: Change "replace" to "delete".
Expected Result: The matched complete lines are removed in the processing result, rather than changed to other text.
Step 5: Proceed to the next step and execute batch processing
After completing the settings, click the Next button at the bottom of the page to proceed to the save location and start processing stages. Although the screenshot mainly shows the first two steps, the top process bar clearly indicates the entire workflow includes:
- Select records to be processed
- Set processing options
- Set save location
- Start processing
Therefore, you just need to follow the workflow to continue setting the output location, and then start processing.
Operation Purpose: Execute the batch deletion task and output the processed txt files.
Expected Result: The software automatically batch processes multiple text files, generating new results with the target paragraphs deleted.
How to understand "paragraph deletion" before and after processing
When processing txt Notepad files, many users understand "paragraph" as a visually distinct block of text. However, judging from the function name in the screenshot, the software currently processes:
Find and replace complete lines in text files based on keywords
Therefore, more precisely, it deletes based on complete lines. For txt files, if a content segment is separated by blank lines, occupies one line per paragraph, or the key content is concentrated in one line, then the actual effect will manifest as "deleting that paragraph".
So, when using it, it is recommended to first confirm your txt structure:
- If a paragraph is exactly one whole line, then deleting the complete line is equivalent to deleting that paragraph;
- If a paragraph spans multiple lines, hitting the rule will at least delete the line containing the keyword.
This is also why, when performing batch deletion of paragraphs in TXT, it is best to first sample and check the structure of a few files before executing in batch.
Common Questions and Precautions
1. How to choose between fuzzy keywords and exact keywords?
If you want to delete fixed sentences or phrases, prioritize using a method that can directly match the text; if you want to delete a category of content, such as numbers, dates, serial numbers, or certain format fragments, it is more suitable to choose Fuzzy text search using formulas.
2. Why can the replacement content on the right be left empty?
Because the interface has prompted: Leaving blank means deletion. This means the matched content is not rewritten but directly removed, making it suitable for batch deletion rather than text replacement.
3. Can multiple txt files be processed at once?
Yes. The screenshot already shows support for Add File and Import Files from Folder, which is precisely the value of office software in batch file processing. Compared to manual editing one by one, the efficiency improvement is very significant.
4. Is case sensitivity a concern?
There is an additional option in the settings area: Ignore letter case. If your keywords have case differences across different files, you can check this option as needed to avoid missing any deletions.
5. Should I back up the original files before processing?
It is recommended to keep a backup of the source files before formal batch processing, or test with a small sample first. This allows you to verify the accuracy of the fuzzy rules before processing all txt Notepad files.
Summary
For office scenarios requiring batch deletion of paragraphs containing a fuzzy keyword in txt Notepad files, using office software like HeSoft Doc Batch Tool is much more efficient than manual modification. Its core value lies in: importing multiple files at once, setting unified rules, and completing deletion in batch, making it particularly suitable for text cleaning, data organizing, and batch processing of repetitive content.
In actual operation, you only need to remember these key points:
- Enter Text Tools, and go into Find and replace complete lines in text files based on keywords;
- Batch import txt files;
- Select Fuzzy text search using formulas;
- Fill in rules in the "List of keywords to search for";
- Leave the "List of replacement keywords" empty to achieve deletion;
- Proceed to the next step and start batch processing.
If you frequently need to process large volumes of txt, doc, docx, table-exported texts, or other office files, it is recommended to standardize this batch processing workflow. Run a test with a small number of files first, confirm the rules are correct, and then execute in batch, which can both reduce the error rate and significantly cut down on repetitive labor.