How to batch delete the content between two specified pieces of text in folder names


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-13 07:08:39
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide

When a large number of folder names contain temporary numbers, version notes, customer markers, or other fields that are no longer needed, renaming them one by one is both time-consuming and prone to omissions. This article uses START and _END as the left and right boundaries to demonstrate how to use office batch processing software to batch-delete all content between two specified texts, while retaining the boundary text and the parts before and after the name. Follow the steps in this article to add folders, configure processing options, and verify the results, and you can efficiently complete unified cleanup for multiple folders.

When organizing project files, client archives, design drafts, receipts, or backup directories, folder names often use a fixed structure, such as "Project Name_START_temporary content_END_status". Here, START and END are used to mark field boundaries, and the middle part may be a batch number, draft version, internal note, personnel code, or temporary label. As archiving rules change, this part may no longer be needed. If there are only a few folders, manual renaming can still work, but when facing dozens or even hundreds of folders, selecting each one, locating the text, and deleting it not only involves a lot of repetitive work, but also makes it easy to accidentally delete prefixes, suffixes, or separators that should be retained.

This article addresses exactly this type of problem: batch deleting all content between two specified texts in many folder names. The example uses "START" as the left text and "_END" as the right text, and the processing does not delete these two boundary markers. Therefore, "Backup_START_tempFiles_END_Final" becomes "Backup_START_END_Final". The entire process is completed through HeSoft Doc Batch Tool . This is a file batch processing software designed for office scenarios, which can convert repeated folder renaming operations into unified rules and reduce the cost of manual modification and review.

1. Applicable Scenarios

"Delete content between two texts" is suitable for situations where folder names have a relatively stable structure. As long as there are identifiable fixed texts on both sides of the content to be deleted, they can be used as boundaries to set processing rules.

  • Clear temporary version fields: For example, "Design_START_oldVersion_END_Approved", where you want to remove oldVersion but keep Design, START, END, and Approved.
  • Delete batch or sequence markers: For example, "Invoice_START_batch001_END_Paid", where batch001 is no longer needed during archiving.
  • Remove internal notes: For example, "Notes_START_privateText_END_Public", where privateText needs to be deleted when organizing materials for external distribution.
  • Clean up project stage codes: For example, "Project_START_alpha_END_Report", where you want to unify different project directories into a concise structure.
  • Batch standardize historical directories: Old folders may contain test characters, migration markers, personnel abbreviations, or source codes, which are suitable for one-time cleanup using the same boundaries.

What is processed here is the folder name, not the body content in Word, doc, docx, Excel, xlsx, PowerPoint, PDF, or images. If these office files are stored in the target folder, the focus of this operation is still only on the name of the folder where they are located. Before execution, you should confirm whether any related shortcuts, scripts, or business systems reference the original folder paths to avoid invalid external paths after renaming.

2. Effect Preview: What Changes Before and After Processing

1. Folder Names Before Processing

Before processing, the example directory contains multiple folders with similar structures. Each name includes START and _END, while the middle text varies, such as tempFiles, debugInfo, 2024Draft, sampleChunk, oldVersion, batch001, and so on. The red markers point to the parts that need to be batch deleted.

image-Batch delete folder name text,batch modify folder names,delete content between two texts,batch rename folders

Take a few of these names as examples:

  • Backup_START_tempFiles_END_Final
  • Build_START_debugInfo_END_Release
  • Client_START_2024Draft_END_Archive
  • Data_START_sampleChunk_END_Clean
  • Task_START_removeThis_END_Done

The length of the middle content in these names is not consistent, so it is not suitable to delete based on a fixed number of characters. A more reliable approach is to identify the left and right text boundaries, and then delete all characters between the boundaries.

2. Folder Names After Processing

After batch processing is completed, the content originally between START and _END is removed, while the boundary text on both sides and the information at both ends of the name remain. The processing result is shown in the following image.

image-Batch delete folder name text,batch modify folder names,delete content between two texts,batch rename folders

Corresponding changes include:

  • Backup_START_tempFiles_END_Final → Backup_START_END_Final
  • Build_START_debugInfo_END_Release → Build_START_END_Release
  • Client_START_2024Draft_END_Archive → Client_START_END_Archive
  • Invoice_START_batch001_END_Paid → Invoice_START_END_Paid
  • Project_START_alpha_END_Report → Project_START_END_Report

From the results, it can be seen that the software does not require the content between the two boundaries to be exactly the same. As long as the corresponding left text and right text can be found in the folder name, the middle field can be cleared according to the same rule. This is also where batch processing is more efficient than manual find-and-replace.

3. Operation Steps: Batch Delete Content Between Two Texts

Step 1: Enter the Delete Folder Name Text Function

Open HeSoft Doc Batch Tool , and select "Folder Name" in the left function category. After entering this category, you can see functions such as find and replace, insert text, add prefix and suffix, case conversion, and delete text. What this article needs to use is "Delete text in folder names".

image-Batch delete folder name text,batch modify folder names,delete content between two texts,batch rename folders

After clicking this function, the software enters a step-by-step processing interface. The purpose of selecting the correct function is to ensure that the subsequent rules are used only for cleaning folder name text, rather than using other rules such as find and replace or adding prefixes and suffixes.

Step 2: Add Folders to Be Processed

On the "Select records to be processed" page, click "Add Folder" in the upper right corner to add the folders that need batch renaming to the task list. In the screenshot, 10 records have already been added, and the table shows the sequence number, name, path, creation time, and modification time for easy verification before execution.

image-Batch delete folder name text,batch modify folder names,delete content between two texts,batch rename folders

Do not rush to click "Next" at this step. It is recommended to complete the following checks first:

  1. Confirm that the names in the list indeed contain the left and right boundary texts you plan to use.
  2. Confirm that the paths point to the correct test directory or formal working directory to avoid selecting the wrong folder with the same name.
  3. Check whether any directories that should not be renamed have been mixed in; if you find wrongly added records, you can use the delete icon in that row's operation area to remove them.
  4. Pay attention to the record count at the bottom of the page and confirm that it is basically consistent with expectations. In the example, the record count is 10.

After verification is complete, click "Next" at the bottom of the page to enter processing rule settings.

Step 3: Select "All Content Between Two Texts"

On the "Set processing options" page, you can see multiple operation types, including all numbers, all Chinese characters, all English letters, all whitespace, some texts at the far left or far right, content around a certain text, position ranges, and so on. The goal of this article is to locate content based on two boundaries, so select "All content between two texts".

image-Batch delete folder name text,batch modify folder names,delete content between two texts,batch rename folders

Then fill in two required fields:

  • Text on the left: Enter START.
  • Text on the right: Enter _END.

Here, the text on the right is "_END", and the underscore is also part of the matching condition. When setting it, you must enter it according to the actual characters in the folder name, including underscores, hyphens, spaces, numbers, and capitalization. If "_END" is mistakenly written as "END", the resulting name structure may differ from expectations, so you should first observe how the original names are separated.

Step 4: Decide Whether to Delete the Left and Right Boundary Texts

The interface provides "Include the text on the left" and "Include the text on the right" switches below the left and right text input boxes respectively. In the example, both switches remain off, meaning that only the content between START and _END is deleted, and the boundary texts themselves are not included in the deletion range.

Therefore, "START_tempFiles_END" will be retained as "START_END" after processing. If the actual requirement is to delete START together, or delete _END together, you can adjust the corresponding switches according to the interface description. But before batch execution, be sure to confirm the result with a small number of samples first, because whether the boundaries are included will directly affect the final names.

After confirming that the rules are correct, click "Next" and continue with the subsequent settings and start processing according to the page flow. Because folder renaming affects paths, before formal execution it is recommended to close windows or programs that are occupying these directories, and ensure that the target folders are not in the process of being copied, synced, or uploaded.

Step 5: Verify the Results After Processing Is Complete

After the task is completed, return to the target directory and focus on checking three positions: whether the beginning of the name is retained, whether START and END are retained as expected, and whether the middle text has been deleted. At the same time, confirm that the endings such as Final, Release, Archive, Clean, and Approved have not been affected.

It is recommended not to check only the first record. You can select several folders from the beginning, middle, and end of the list to verify, especially names with different middle content lengths, numbers, or uppercase and lowercase letters. After confirming that the rules are effective for multiple samples, you can apply the same method to a larger batch.

4. Common Questions and Precautions

1. Why did some individual folders not change?

A common reason is that the left and right boundaries do not both appear in the folder name, or the actual characters differ from the input content. For example, the original name uses "Start", but the settings enter "START"; the original name contains "_END", but the underscore is omitted during setup. It is recommended to copy the boundary characters from the original name to reduce manual input errors.

2. Do the left and right texts have to be immediately adjacent to the content to be deleted?

The core of the rule is to find the left text and right text and clear the content between them. The area between boundaries can contain letters, numbers, Chinese characters, spaces, or underscores, and the lengths can also differ. However, the left and right boundaries themselves should be stable; otherwise, there may be cases of no match or a match range that does not meet expectations.

3. How should it be set when boundary text needs to be retained?

According to the example, keep both "Include the text on the left" and "Include the text on the right" off. This way, only the middle content is deleted, and START and _END remain. If a switch is turned on, the corresponding boundary may be included in the deletion range, so the settings should be confirmed again afterward.

4. What if the same boundary appears multiple times in one name?

If START or _END appears repeatedly in the same folder name, the matching range may no longer be intuitive. It is recommended to copy a small number of folders for testing first, observe whether the results conform to the naming rules, and then decide whether to batch process. Do not try complex rules directly on the only important directory.

5. Is a backup needed before batch renaming?

For project delivery directories, original client materials, financial archives, or office folders that are being synced, it is recommended to back up the name list first, and if necessary, copy a test directory. You should also confirm that no programs depend on the original paths. Batch tools can significantly reduce repetitive operations, but accurate boundary settings and pre-execution verification are still indispensable.

6. Can it be used for directories containing different types of files?

It can be judged based on the folder naming structure, rather than the internal file format. Regardless of whether the directory contains Word doc, docx, Excel xls, xlsx, or PPT, PDF, images, or text materials, as long as the goal this time is to organize folder names, the left and right boundaries in the directory names should be the basis for the settings.

5. Summary

The key to batch deleting content between two texts in folder names is to first identify stable left text and right text, and then decide whether to retain the boundaries. The example in this article selects "Delete text in folder names" in HeSoft Doc Batch Tool , adds the target directories, selects "All content between two texts", and enters START and _END respectively, ultimately clearing the temporary fields in multiple folders at once.

Compared with renaming one by one, office batch processing software can execute the same rule uniformly, and is especially suitable for project archiving, material delivery, historical directory organization, and batch cleanup. In actual operation, it is recommended to first select a small number of copies for testing, confirm that the boundaries, underscores, and switch states are all correct, and then process the complete directory. Now you can first organize a group of folders with the same naming structure, add them according to the process in this article, verify them in advance, and replace multiple repeated renaming operations with one rule.


Keyword:Batch delete folder name text , batch modify folder names , delete content between two texts , batch rename folders
Creation Time:2026-10-13 07:08:22
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.