Many office document folders come with random numbers, serial numbers, or system-generated numeric suffixes. During subsequent archiving, testing, or delivery, a unified renaming is often required. This article uses HeSoft Doc Batch Tool to demonstrate the method for batch fuzzy replacement of folder names: first add multiple folders, then choose to use a formula to perform a fuzzy text search, match three-digit numbers using a rule like \d{3}, and uniformly replace them with -TEST. The tutorial combines before-and-after processing results with operation screenshots to help users quickly master the practical workflow of batch renaming folders using regex rules.
When organizing company data, delivering projects, preparing test data, and maintaining departmental shared drives, a common situation arises: the overall structure of folder names is similar, but a segment of random characters differs. For example, a batch of folders might be named "INV4X812", "ORD7A293", "PO9C376", "REQ8F194", "SO2D705". If you need to uniformly rename these folders to test directory names, the most straightforward approach is to right-click and rename each one individually, but this is clearly not an efficient office practice.
The real challenge is that these codes are not the same fixed text, so they cannot be replaced with a simple find-and-replace in one go. This requires using wildcards, regular expressions, or a software interface's "formula fuzzy search" capability to match these different characters based on a pattern, and then batch-replace them with uniform content.
This article uses HeSoft Doc Batch Tool as an example to explain how to batch-modify the names of many folders using a fuzzy approach. This software is positioned as an office document batch processing tool, suitable for batch processing files, folders, and various document types in daily work, helping users reduce repetitive tasks. The example below will replace the three-digit random codes in the folder names with "-TEST".
Applicable Scenarios: Batch Processing Random Codes, Serial Numbers, and Date Suffixes
Batch fuzzy replacement of folder names is suitable for handling naming issues where "the content differs but the pattern is the same." A consistent pattern means that although the specific characters in each folder are different, their type, length, or position is similar. For instance, all are three digits, a four-digit year, a fixed-format date, or a segment of a code exported by a system.
The following scenarios can all be addressed using the approach in this article:
- Batch Renaming Test Data: Uniformly replace the random codes at the end of original project directories with "-TEST" to distinguish test environment data.
- Standardizing Archive Directories: Replace old, temporary, or exported codes in folder names with a unified archiving identifier.
- Organizing Order Folders: Batch process non-fixed text like order numbers, customer IDs, and batch numbers.
- Cleaning Up Before Project Delivery: Delete or replace internal serial numbers before delivery to make directory names clearer.
- Maintaining Office Shared Drives: Perform batch naming corrections on non-standard folders created by multiple people, reducing the cost of manual verification.
If your need is to batch modify the filenames of doc, docx, xls, xlsx, ppt, pptx, pdf, and other files, you will need to use the file name-related functions; this article discusses the batch modification of "folder names," which applies to renaming the directories themselves.
Result Preview: From Random Three-Digit Numbers to a Uniform "-TEST" Suffix
Before starting the operation, first clarify the processing goal. We are not adding a prefix simply deleting a fixed text string, but rather replacing the numerical part of the folder name that matches a rule with a specified suffix.
Before Processing: Different Codes at the End of Folder Names
From the pre-processing screenshot, you can see the folders to be processed include "INV4X812," "ORD7A293," "PO9C376," "REQ8F194," and "SO2D705." Their common feature is that the beginning contains different alphanumeric codes, and the end has three digits.

If there were only five folders, manual modification might seem feasible; however, in a real office environment, such folders often number in the dozens or even hundreds, not just five. As long as the naming pattern is the same, the repetitive work can be handed over to a batch processing tool.
After Processing: Three-Digit Numbers Uniformly Replaced with -TEST
After processing, the three-digit numbers in the folder names have been changed to "-TEST". This means the original "INV4X812" has become "INV4X-TEST," "ORD7A293" has become "ORD7A-TEST," and the other folders have been replaced following the same rule.

This result demonstrates that the software identifies the target segments in different folders based on a rule and preserves the unchanged parts of the folder names. For office users who need to batch-unify naming formats, this is more stable and time-saving than navigating to each folder's location and manually renaming it individually.
Operational Steps: Completing Batch Folder Renaming Using Formula Fuzzy Search
Below, we will explain step-by-step, with operational screenshots, how to complete the setup in HeSoft Doc Batch Tool . For clarity, each step will explain its purpose and the expected result.
Step 1: Select the Find and Replace Function Under "Folder Name"
After opening the software, the left side contains the function category navigation. Since our goal is to modify folder names, click "Folder Name" on the left. After entering this category, the page will display multiple function cards related to folder naming.
In the screenshot, the first function is "Find and Replace Keywords in Folder Names", with the description text indicating it performs a batch search and replace of keywords in file folder names. This function is the best match for our current requirement, which is to "first find the codes in the names, then replace them with a new suffix."

The expected result of this step is to enter the folder name find-and-replace workflow. If you mistakenly select "Insert Text in Folder Name," it is more suitable for appending content at a specific position; if you mistakenly select "Add Prefix and Suffix to Folder Name," it is only good for uniformly adding prefixes/suffixes and cannot target existing random codes within the name for replacement. Therefore, the function selection must align with the processing goal.
Step 2: Add the Folder Records to Be Processed
After entering the function, the interface displays a step-by-step workflow. The first step is "Select records to process." At this point, you need to click "Add Folders" in the upper right corner to add the folders requiring batch renaming to the list.
The screenshot shows five folders have been added, and the list displays columns for sequence number, name, path, creation time, modification time, and operations. The name column helps you verify the current folder names, and the path column confirms whether the directories of these folders are correct.

Checking after adding is very important. Once batch renaming is executed, it will simultaneously affect multiple folders in the list. If irrelevant directories are accidentally added, it could lead to unnecessary name changes. Therefore, before clicking the next step, it is advisable to focus on three checks: whether the folder count is correct, whether the paths are correct, and whether the names conform to the rule intended for this processing.
The interface also shows buttons like "Clear," "More," "Filter," "Sort." It can be reasonably deduced from the screenshot that these buttons assist in managing the current list. For example, if an item is added by mistake, you can use clear to re-select; when there are many records, filtering or sorting can improve verification efficiency.
Step 3: Click Next to Enter "Set Processing Options"
After confirming the folder list is correct, click "Next" at the bottom to enter the second step, "Set processing options." This step is the core of the entire batch fuzzy replacement, as both the search rule and the replacement content are set here.
The screenshot shows the process progress at the top has reached step 2, and the section title is "Set Keyword Options." It contains "Search mode," "Additional options," "List of keywords to find," and "List of keywords to replace with."

If your goal is to batch-replace a fixed word, you could choose exact search; however, in this example, 812, 293, 376, 194, and 705 are all different, necessitating a fuzzy matching approach.
Step 4: Select "Use Formula Fuzzy Search for Text"
In the "Search mode" section, select "Use formula fuzzy search for text". This step is equivalent to telling the software: don't just look for a fixed string, but identify a class of text based on a rule.
For many office users, "Use formula fuzzy search for text" can be understood as an application of regular expression or wildcard rules. It is particularly suitable for handling batch naming problems involving non-fixed numbers, codes, dates, etc.
In this example, all the content to be replaced consists of three-digit numbers, so we only need to use one rule to express this type of content.
Step 5: Enter \d{3} in the List of Keywords to Find
In the left-hand "List of keywords to find" box, enter:
\d{3}This rule means match three consecutive digits. It will match "812," "293," "376," "194," and "705" in the example folder names.
The key here is not to memorize a specific symbol, but to understand the rule design approach: first observe the common characteristics of the content in the folder names that needs replacing, and then write this common characteristic as an expression. The common characteristic in this example is "three consecutive digits."
If your actual folder names contain four-digit codes, the rule might need adjustment; if it's a combination of fixed text and numbers, the design should be based on the actual name structure. To avoid mismatches, it is recommended to test on a small sample before formal processing.
Step 6: Enter -TEST in the List of Keywords to Replace With
In the right-hand "List of keywords to replace with" box, enter:
-TESTThis means that any three-digit number matched by the left-hand rule will be replaced with "-TEST." After processing, the software will retain the unmatched parts and only replace the target segment. So, "INV4X812" will not completely become "-TEST", but rather "INV4X-TEST".
This setup method is suitable for scenarios where you need to keep the main body code and only replace the numerical suffix. If you wish to replace it with other content, you can fill it in according to business standards, such as "-DONE", "-ARCHIVE", "-Final". It is recommended to keep the naming short and clear to avoid excessively long directory levels or difficulties in searching later.
Step 7: Continue to the Next Step, Complete Save Location Settings, and Start Processing
The process shown in the screenshot indicates there are subsequent steps for "Set save location" and "Start processing." After completing the search rule and replacement text settings, click "Next" at the bottom and follow the on-screen prompts to finish the remaining steps.
Since batch processing involves multiple folder names, it is advisable to double-check the settings before proceeding to the final step. Especially verify: that the search mode is "Use formula fuzzy search for text"; that the left-hand box contains \d{3}; that the right-hand box contains -TEST; and that the pending list only includes the target folders. Confirming all this before executing can significantly reduce operational errors.
Why This Batch Fuzzy Replacement Is More Suitable for Office Scenarios Than Manual Renaming
The biggest problem with manual renaming is not the complexity of a single operation, but the sheer number of repetitions. Each folder requires clicking, navigating, selecting the code, entering new text, and confirming. With a large number of folders, omissions, typos, or formatting inconsistencies are highly likely.
Using office software like HeSoft Doc Batch Tool can consolidate repetitive actions into a single rule setup. Users only need to focus on "which folders to process" and "what rule to use for replacement," and the software handles the batch execution. For those who frequently organize data, this method offers several clear advantages:
- Higher Efficiency: Process multiple folders at once, eliminating the need to rename each one individually.
- More Uniform Formatting: The replacement content is generated uniformly by the rule, reducing human input variation.
- More Suitable for Large Volumes of Data: The more folders there are, the more noticeable the time-saving effect of batch processing.
- Facilitates Standardized Workflows: Project teams or departments can unify naming conventions and reuse similar methods.
This is especially true when dealing with exported data, test directories, or project archive directories, where folder names are often batch-generated. Problems stemming from batch generation are also more suitable to be solved with batch tools.
Common Questions and Precautions
1. Does \d{3} only match numbers at the end?
Based on the expression's meaning, \d{3} represents three consecutive digits and is not inherently restricted to the end of a string. In this article's example, the target digits happen to be at the end of the folder names, so the expected result is achieved. If your folder name has three consecutive digits in the middle as well, you need to carefully check the rule to ensure it doesn't match numbers you don't intend to replace.
2. What happens if a folder name has no three-digit numbers?
Typically, names that don't match the search rule will not be affected and thus will not be replaced according to that rule. However, to ensure accurate results, it's still recommended to review the list after adding folders and try to include only the target folders that match the current rule.
3. Could there be duplicate names after replacing with -TEST?
If multiple folders end up with the exact same name after replacement, naming conflicts can occur. This example preserved the initial code segments, like INV4X, ORD7A, PO9C, etc., so the names remain distinct after processing. In practice, you must assess in advance whether the replaced names will still be unique.
4. Can the numbers simply be deleted?
The hint next to the "List of keywords to replace with" box in the screenshot states, "Leave empty to delete." Therefore, in similar scenarios, if no replacement content is filled in, it might be used to delete the matched text. However, the goal in this article's example is to replace with "-TEST," so specific text is entered in the right-hand box. In actual operation, you should choose to replace or delete based on your own needs.
5. Is it necessary to back up the original folders before processing?
Backing up important data is advisable. The advantage of batch processing is its speed, but that also means an incorrect rule can quickly affect many objects. Especially for project delivery directories, contract archive directories, customer data directories, etc., it is recommended to first copy a sample directory for testing and process the official batch only after confirming the results are correct.
6. How does this method relate to batch processing in Word, Excel, or PDF?
They all belong to the mindset of office batch processing, just with different processing objects. A Word document might be a .doc or .docx file, an Excel spreadsheet an .xls or .xlsx file, and a PDF is a document format, whereas this article deals with folder names. The navigation on the left side of HeSoft Doc Batch Tool provides multiple categories, and users should select the corresponding function based on their specific processing object.
Summary: Mastering Rule-Based Matching for More Efficient Batch Folder Renaming
This article demonstrated, using a typical example, how to use a wildcard/regex approach to batch-modify folder names using a fuzzy method. Before processing, multiple folder names ended with different three-digit numbers; after processing, these numbers were uniformly replaced with "-TEST", making the folder names more standardized and easier to identify.
The entire process is not complicated: In HeSoft Doc Batch Tool , enter the "Folder Name" category, select "Find and Replace Keywords in Folder Names," add the target folders, select "Use formula fuzzy search for text" in the processing options, enter \d{3} as the search rule, enter -TEST as the replacement content, and finally proceed with the remaining interface steps to complete the task.
For users who frequently handle large volumes of project data, order directories, test folders, or shared drive materials, this method of batch fuzzy replacement can significantly reduce repetitive work. It is recommended that in your practical work, you first observe the folder naming pattern, then design the matching rule, and after testing on a small scale, apply it to the official directories. This approach boosts efficiency while ensuring stable and reliable batch renaming results.