Folder Name Batch Removal of Trailing Numbers: How to Replace Keywords Using Wildcard Regex


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-07-30 07:05:17

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

When a large number of folder names contain numbers, dates, serial numbers, or meaningless characters with fixed patterns, renaming them one by one by right-clicking is not only time-consuming but also easy to miss changes. This article takes the batch removal of the last three digits of folder names as an example to demonstrate how to use formulas in HeSoft Doc Batch Tool to perform fuzzy text matching. By using the regular expression \d{3} to match digits and leaving the replacement content empty, multiple folder names can be cleaned up at once, making it suitable for data organization, project archiving, and batch file management scenarios.

In daily office work, folder names often contain unwanted numbers or keywords due to system exports, project codes, client file archiving, batch downloads, and other reasons. For example, you might only want to keep the main identifiers like INV4X, ORD7A, PO9C, but the folder names have appended three-digit numbers such as 812, 293, 376. If there are only a few folders, manual renaming is acceptable; but with dozens, hundreds, or even more folders, deleting keywords from names one by one becomes repetitive labor.

The problem addressed in this article is very specific: using wildcard regular expressions to batch-delete keywords from many folder names. In the example, we will use the folder name processing feature of the office software " HeSoft Doc Batch Tool " to batch-delete three-digit numbers that match a specific pattern from multiple folder names. The entire process does not require opening folders individually or manually copying and pasting names, making it suitable for office scenarios that need batch file processing to reduce repetitive tasks and improve organization efficiency.

Applicable Scenarios: Which Folder Names Are Suitable for Fuzzy Deletion Using Regex

The advantage of fuzzy searching with regular expressions or wildcards is that it does not search for just one fixed term but can find "a category of text that matches a rule." For example, the folder names in this case do not all contain the same fixed keyword but include different numbers like 812, 293, 376, 194, 705. Using a standard exact search would require entering multiple numbers individually; however, using an expression like \d{3} can uniformly match three consecutive digits.

This type of operation is especially suitable for the following scenarios:

  • Deleting serial numbers from folder names: For example, "ContractA001," "ContractB002," "ContractC003," where you need to batch-remove the trailing numbers.
  • Cleaning up system-generated random codes: Many management systems, ERPs, CRMs, and download platforms automatically append numbers, dates, or codes to folders.
  • Organizing project document directories: Project folder names have phase numbers, batch numbers, or version numbers at the beginning or end that need to be uniformly removed.
  • Batch standardizing client or order folders: For instance, keeping letter codes in order directories while deleting suffix numbers to facilitate subsequent sorting and searching.
  • Office document archiving: Batch cleaning of redundant characters in names during file sorting, folder classification, and data backup.

It is important to note that this demonstration involves folder name processing, not the content of Word, docx, doc, Excel, or PDF files. Its goal is to modify the names of the folders themselves. If your data directory contains Word documents, Excel spreadsheets, PDF files, and image files simultaneously, you can first standardize the folder names before proceeding with other batch processing tasks.

Preview: Folder Names Contain Irregular Numbers Before Processing

As you can see from the pre-processing screenshot, multiple folder names have three-digit numbers appended to them. For example, INV4X812, ORD7A293, PO9C376, REQ8F194, SO2D705. Although these numbers are different, they follow a consistent rule: they are all three consecutive digits located at the end of the folder name.

If you delete them one by one, you would need to change INV4X812 to INV4X, ORD7A293 to ORD7A, and so on. This isn't a major issue with a small number, but with a large volume of data, manual operations are highly prone to missed deletions, accidental deletions, spelling errors, and other problems.

image-Rename folders in bulk by removing keywords using regular expressions,modify folder names in batches

Preview: Three-Digit Keywords Batch-Deleted After Processing

After processing, the three-digit numbers in the folder names have been uniformly deleted, leaving only the main part from before. The example folders now appear as INV4X, ORD7A, PO9C, REQ8F, SO2D. The modification times in the screenshot also indicate that these folders were renamed within the same batch process.

image-Rename folders in bulk by removing keywords using regular expressions,modify folder names in batches

This result demonstrates that as long as the content to be deleted in folder names follows a uniform pattern, you can use regular expressions or wildcard rules for batch fuzzy matching and set the replacement content to empty, thus achieving the effect of "batch-deleting keywords."

Operation Step 1: Enter the Folder Name Processing Tool

After opening " HeSoft Doc Batch Tool ", you can see multiple office processing categories in the left function area, including File Name, Folder Name, File Organization, Word Tools, Excel Tools, PowerPoint Tools, PDF Tools, and more. Since we need to process folder names here, select the Folder Name category on the left.

In the folder name function list, select Find and Replace Keywords in Folder Names. This function is used to batch-find specified text in folder names and replace it with new text; when the replacement content is left empty, it achieves the purpose of batch-deleting text.

image-Rename folders in bulk by removing keywords using regular expressions,modify folder names in batches

The purpose of this step is to enter the correct entry point for batch renaming. Since we are processing folder names, avoid mistakenly selecting "File Name" or document-type tools. After entering the function, subsequent operations will revolve around steps like selecting records, setting processing options, setting the save location, and starting processing.

Operation Step 2: Add the Folders to Be Processed

After entering the "Find and Replace Keywords in Folder Names" page, the top of the interface provides an Add Folders button. Click this button to add the folders that need batch processing to the task list. As shown in the screenshot, 5 records have been added, corresponding to 5 folders, and the list displays serial numbers, names, paths, creation times, modification times, and an operation column.

image-Rename folders in bulk by removing keywords using regular expressions,modify folder names in batches

The purpose of this step is to let the software know which folders to perform batch renaming on. After adding them, it is recommended to check if the names and paths in the list are correct. For example, in the screenshot, the paths are located in the D:\test\ directory, and the names are INV4X812, ORD7A293, PO9C376, REQ8F194, SO2D705. Once confirmed, click the Next button at the bottom to enter the rule settings.

If there are folders in the list that don't need processing, they can be removed according to the operation column in the interface; if there are many folders, you can also use the page's list assistance capabilities like filtering and sorting to check the records. This helps avoid including directories that should not be renamed in the batch task.

Operation Step 3: Select Fuzzy Formula Text Search and Enter the Regular Expression

After entering Step 2 "Set Processing Options," the focus is on setting the search method and replacement rules. As seen in the screenshot, there are two options in the "Search Method" area: Exact Text Search and Use Formula for Fuzzy Text Search. This case requires deleting different three-digit numbers, not the same fixed keyword, so you need to select Use Formula for Fuzzy Text Search.

image-Rename folders in bulk by removing keywords using regular expressions,modify folder names in batches

In the "List of Keywords to Find" on the left, enter \d{3}. The meaning here can be simply understood as: match 3 consecutive digits. The numbers 812, 293, 376, 194, 705 at the end of the example folder names all conform to this rule and will therefore be uniformly found.

On the right is the "List of Keywords for Replacement." The prompt in the screenshot says "leaving it blank means delete," so keep this empty. This means the software will look for content in the folder names that matches \d{3} and replace it with empty content, ultimately resulting in the deletion of those three-digit numbers.

This step is the key to the entire operation. Compared to a standard search, formula-based or fuzzy regex search can handle texts that are not identical but follow a consistent pattern. For scenarios involving batch deletion of numbers, dates, codes, version numbers, etc., from folder names, this method is much more efficient than entering keywords one by one.

Operation Step 4: Proceed to the Next Step and Execute Batch Processing

After setting the search rules and replacement rules, click the Next button at the bottom of the page. The interface flow also includes "Set Save Location" and "Start Processing" steps. Follow the page prompts to continue, confirm the save or processing location, and then enter the start processing phase.

Since this function processes folder names, it is recommended to double-check the following before starting: Are the folders in the task list correct? Is the search method set to "Use Formula for Fuzzy Text Search"? Is the keyword to find \d{3}? Is the replacement keyword list empty? Start the batch processing only after confirming everything is correct.

After the processing is complete, go back to the folder's location to check. You will see that the names have changed from forms like INV4X812, ORD7A293, etc., to forms like INV4X, ORD7A. The entire process only requires setting a rule once to batch-clean multiple folder names.

Frequently Asked Questions and Notes

1. Why use \d{3} instead of entering 812, 293, 376 one by one?

Because although these numbers have different specific content, they all belong to the category of three consecutive digits. Using \d{3} can match similar content in one go, making it suitable for batch fuzzy deletion. Entering them individually is not only cumbersome but also not conducive to handling a larger number of folders.

2. What if I need to delete two-digit or four-digit numbers?

Adjust the expression according to the actual pattern. For example, for two consecutive digits, consider using \d{2}; for four consecutive digits, consider using \d{4}. It is advisable to first confirm the pattern in the folder names before operation to avoid matching content that shouldn't be deleted.

3. Why should the replacement keyword be left blank?

In this function, leaving the replacement keyword blank indicates deletion. That is, the found content is replaced with nothing, so the three-digit numbers are removed from the folder names.

4. Will this affect Word, Excel, or PDF files inside the folders?

This operation processes folder names, not the content of documents inside the folders. Generally, it will not modify the content of docx, doc, xlsx, pdf, etc., files. However, after a folder name changes, shortcuts, external references, or scripts that depend on the original path may need to be adjusted accordingly.

5. Is a backup necessary before batch operations?

For important data directories, it is recommended to first copy a test sample, confirm the rules match correctly, and then process all folders. Especially when the regex matching range is broad, small-scale verification should be conducted first.

Summary: Replace Repetitive Renaming with Batch Processing

Batch-deleting keywords from folder names is essentially a form of name standardization. Through the "Find and Replace Keywords in Folder Names" function of " HeSoft Doc Batch Tool ", you can convert the repetitive operation of manually renaming each folder one by one into a single rule setup and batch execution. For scenarios like office file organization, project document archiving, order directory cleanup, and standardizing system-exported folders, this method significantly reduces manual operation time.

If your folder names also contain similar trailing numbers, random codes, date markers, or batch numbers, first observe their common pattern, then use the formula for fuzzy text searching to match them. Once you confirm the replacement content is left blank, you can achieve batch deletion. It is recommended to start testing with a small sample batch and apply the rules to the entire directory only after confirming they are correct. This approach is both efficient and safe.


Keyword:Rename folders in bulk by removing keywords using regular expressions , modify folder names in batches
Creation Time:2026-07-30 07:05:01

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

Related Articles

Don't see the feature you want?

Provide us with your feedback, and after evaluation, we will implement it for free!