, when there are similar but not completely consistent contents in multiple txt texts, manually searching and replacing files one by one is not only time-consuming, but also easy to miss changes. This article describes how to use office software" HeSoft Doc Batch Tool ", batch replace the entire paragraph containing fuzzy keywords in txt with new text. The article will combine the actual operation interface to explain the applicable scene, the effect before and after processing, the specific steps and matters needing attention, to help you quickly complete the text cleaning, content unification, batch revision and other work, reduce duplication of labor, improve the efficiency of document processing.
A lot of people are sortingTXT text fileAt the same time, we will encounter such problems: there are some paragraphs in the same batch of documents that need to be replaced uniformly, but these paragraphs are not exactly the same, but allContains certain keywords or similar expressions. If you open txt files one by one, manually search, delete and paste new content one by one, the workload is heavy and error-prone.
This article is to solve this scenario:Batch replace paragraphs containing fuzzy keywords in txt with new text. According to the screenshots, we can see that we are using office software. HeSoft Doc Batch Tool It is suitable for processing a large number of documents, especially for batch modification of text content, uniform data format, reduce duplication of work.
Applicable Scenarios
If you have the following requirements, this method is very suitable:
- Batch clean up the specified description section, old version description and invalid content in multiple txt files;
- Locate the entire paragraph by keyword and replace it with a new standard text;
- There is a slight difference in the text content, which cannot be found only by "exact match;
- You need to process batches of notepad files, text files, rather than just changing one file.
For example: some txt text contains digital years, fixed phrases or a paragraph of explanatory text, as long as hit these keywords, the corresponding whole paragraph is replaced with new content. This processing method is especially suitable for office scenes such as knowledge base sorting, collected text cleaning, batch proofreading, copy updating, etc.
Effect Preview
Before treatment
As can be seen from the example screenshot, there are two paragraphs in the original txt file that need to be processed:
- A paragraph contains a similar13.8such digital content;
- Another paragraph contains a phraseIn this sense.

These are located in the entire paragraph in which they are located, not just replacing a word, butReplace the whole paragraph containing the keyword.
After treatment
After the processing is completed, the entire content of the original hit keyword is replaced by the new text.

In the example you can see:
- The entire paragraph that hits the first rule is replacedtestA;
- The entire paragraph that hits the second rule is replacedtestB.
Other paragraphs that do not hit the rule remain unchanged. This allows you to quickly complete batch replacements without manually editing them one by one.
Operation steps
Step 1: Enter the corresponding function in the text tool
Open HeSoft Doc Batch Tool on the left ribbon selectText Tools. From the feature list, clickFind and replace entire lines in a text file based on a keyword.
As can be seen from the screenshots, the description of this function is to process the whole line or paragraph for the keywords in the text file, which exactly corresponds to the requirements of this article: locate by keyword and replace it with new text.

The purpose of this step:Enter the correct batch processing module.
Expected results:Enter the file import and processing configuration interface.
Step 2: Batch add TXT files that need to be processed
After entering the function page, import the file in Step 1 "Select Records to Process. The following buttons can be seen at the top right of the interface:
- Add File
- Import files from a folder
- Empty
- More
If you are only dealing with a small number of txt files, you can clickAdd File; If you want to process text files in the entire directory at once, use it directly.Import files from a folderwill be more efficient.

In the screenshot, 10 txt files have been imported in batches. The file name, path, extension, creation time, modification time and other information are displayed in the list for easy verification.
The purpose of this step:Load all pending txt text files at once.
Expected results:The imported txt records can be seen in the file list. Click at the bottom after confirming that they are correct.Next step.
Step 3: Select a fuzzy lookup method
After entering "Set Processing Options", first set the search method. As can be clearly seen from the screenshot, the selection in "Find Method" is:
Blur find text with formulas
This step is crucial. Because this article dealsParagraph substitution with fuzzy keywords, It is not a strict word-for-word search, so fuzzy search should be used instead of "exact text search".
In addition, there is a "ignore the case of letters" option in the interface. If the case of your txt file in Chinese and English may not be uniform, you can consider whether to check it according to the actual situation.

The purpose of this step:Let the software identify content according to fuzzy rules to improve matching flexibility.
Expected results:The system will search according to the filled expression or keyword rule.
Step 4: Fill in the list of keywords to find
On the leftList of keywords to findenter the content to match. Two items are filled in the screenshot example:
- \d
- In this sense
From the interface state, matching according to fuzzy rules is supported here, so you can fill in both fixed phrases and search content with rule features. In the example\dfor matching digital content,In this senseis used to match paragraphs that contain the phrase.
The purpose of this step:Tell the software "what content fortune-telling target paragraph".
Expected results:The software looks in each txt file for the complete contents of these keywords or rules.
Step 5: Fill in the new text after replacement
on the right side ofList of keywords after replacementEnter the corresponding new text. The two replacements in the screenshot are:
- testA
- testB
This means:
- The complete content of the first find rule hit, replacetestA;
- The complete content of the second find rule hit, replacedtestB.
The left and right lists are one-to-one correspondence, so pay attention to the same order when filling in.
The purpose of this step:Specify the replacement result for each find rule.
Expected results:Each hit paragraph can be replaced with new text according to the corresponding rules.
Step 6: Continue to the next step and perform batch processing
After setting up the find rules and replace content, click at the bottom of the page.Next stepContinue with the follow-up process. According to the top step prompt of the interface, the next step will enter:
- Set Save Location
- Start processing
In other words, after the rule configuration is completed, set the storage location of the processing results, and then perform batch replacement.
The purpose of this step:Submit processing rules and start batch execution.
Expected results:The software automatically processes all imported txt files, replacing target paragraphs containing fuzzy keywords with the new text you specify.
Frequently Asked Questions or Precautions
1. What is the difference between fuzzy search and exact search?
If your target content is slightly different in different txt files, or if you need to match the content according to a certain pattern, you should use it first.Blur find text with formulas. If the content is exactly the same, it is more suitable to use precise search.
2. Do the search list and the replacement list have to be in the same order?
Be consistent. The first article on the left corresponds to the first article on the right, and the second article on the left corresponds to the second article on the right. Otherwise, the problem that the replacement result does not meet the expectation easily occurs.
3. Is this a replacement of a single word or an entire paragraph?
Judging from the effect before and after the screenshot, the result of processing here is:As long as the keyword is hit, the corresponding complete paragraph content will be replaced by the new text.. Therefore, it is suitable for deleting, rewriting and replacing the whole paragraph, rather than simply changing a word.
4. Do you want to back up the files before processing?
It is recommended that you back up the original txt file before formal batch processing, especially when the rules are complex and the number of files is large. It will be safer to test with a small number of samples first and then process all the documents after confirming that the results are correct.
5. What text file scenarios can be handled?
This article showstxtText file batch replacement scenarios, suitable for notepad files, plain text data, batch exported text content finishing, etc. If you still have document processing requirements such as doc, docx, Excel, PDF, etc., you can also continue batch processing in combination with other modules in this type of office software.
Summary
For"Batch replace paragraphs containing fuzzy keywords in txt with new text"This kind of demand, manual processing efficiency is low, repeated labor, and. HeSoft Doc Batch Tool The advantage of this kind of office software is that it can convert the work that was originally opened one by one, searched and replaced one by one into one configuration and batch completion.
In practice, you only need:
- Enter the corresponding function in the text tool;
- Batch import txt files;
- Select "Find Text with Formula Blur";
- Fill in the search keyword list and the replacement content list;
- Set the save location and start processing.
If you often need to organize text in batches, unify content, and clean data, it is recommended to fix this process directly. First take a few sample text test rules, confirm the correct and then batch execution, can significantly reduce duplication of labor, improve document processing efficiency.