How to batch delete the content between two specified texts in folder names? Operation method to retain the before and after markers


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-12 22:39:09
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 use the structure "fixed prefix_START_temporary content_END_fixed suffix", deleting the middle field one by one is both time-consuming and prone to omissions. This article uses HeSoft Doc Batch Tool as an example to introduce how to batch import folders, select "all content between two texts", set the left text and right text respectively, and complete batch processing while preserving the boundary markers. After processing, the variable content between START and _END will be uniformly deleted, and the materials in the folders will not be changed due to renaming.

During project archiving, client data organization, design version management, or shared drive maintenance, we often encounter a batch of folder names with similar structures but containing temporary fields. For example, folders uniformly use naming patterns such as "Backup_START_tempFiles_END_Final" and "Client_START_2024Draft_END_Archive", where START and _END are fixed markers, while the text between the two markers, such as tempFiles, 2024Draft, and sampleChunk, is no longer needed.

If there are only a few folders, you can rename them manually one by one; however, when there are dozens, hundreds, or even more items to process, repeatedly selecting, pressing F2, locating text, deleting, and confirming is not only time-consuming but can also lead to missed deletions, accidental removal of boundary markers, or input errors. A more efficient approach is to use the batch folder processing feature in office software to delete all content between two specified texts in one go according to a unified rule.

Below, using HeSoft Doc Batch Tool as an example, we explain how to batch delete characters between two texts in folder names. This tool is positioned as office software for batch document and file processing, which can turn repetitive renaming work into unified rule-based processing, making it suitable for users who need to continuously organize large numbers of files, folders, and office materials such as Word, Excel, and PDF documents.

Applicable Scenarios

This method of batch deleting the middle content of folder names is suitable for folders whose names share common boundary markers. That is, each name contains identical or clearly defined "left text" and "right text", and the content to be cleaned up is located between them.

  • Project version archiving: Delete draft numbers, version numbers, test batches, or development codenames between START and END.
  • Client data organization: Remove temporary client IDs, internal notes, follow-up statuses, or handover markers from folder names.
  • Design and asset management: Batch remove staged descriptions such as rawSet, oldVersion, and sampleChunk.
  • Standardization of financial and administrative materials: Remove batch numbers, handler abbreviations, or temporary review fields while preserving the category names before and after.
  • Migrating historical data: Folder names exported from legacy systems often contain fixed separator markers, so redundant middle fields can be removed uniformly before migration.

It should be noted that the key to this method is not whether the middle content is the same, but whether the positioning text on the left and right sides is stable. The ten folders in the screenshot have different middle content such as tempFiles, debugInfo, 2024Draft, sampleChunk, and oldVersion, but they are all located between START and _END, so they can be batch processed using the same rule.

Effect Preview: What Changes Before and After Processing

Before Processing: Middle Field Length and Content Are Inconsistent

The folder names before processing are shown in the image below. Each name contains the segment "START_variable text_END", but the variable text is not the same. Some are English words, some are combinations of English and numbers, and some may be longer remarks. When deleting manually, you need to determine the start and end positions one by one, and the workload increases rapidly with the number of folders.

image-Batch delete the middle content of folder names,batch modify folder names,delete characters between two texts,batch rename folders

Taking a few names as examples:

  • Backup_START_tempFiles_END_Final
  • Client_START_2024Draft_END_Archive
  • Invoice_START_batch001_END_Paid
  • Task_START_removeThis_END_Done

The goal this time is to delete all content between START and _END while preserving the boundary text on both sides. Because the original name has an underscore after START, and the right positioning text is set to "_END", the result after processing will form the connection "START_END".

After Processing: Uniformly Preserve the START_END Structure

After batch processing is completed, middle fields such as tempFiles, 2024Draft, batch001, and removeThis are uniformly deleted, while the valid parts before and after the names and the START and END markers are still preserved.

image-Batch delete the middle content of folder names,batch modify folder names,delete characters between two texts,batch rename folders

For example, "Backup_START_tempFiles_END_Final" becomes "Backup_START_END_Final", and "Client_START_2024Draft_END_Archive" becomes "Client_START_END_Archive". From the before-and-after comparison, it can be seen that the software does not require the middle content to be completely identical. As long as the range can be determined based on the left and right texts, the same deletion rule can be applied to multiple folders.

Operation Steps: Batch Delete All Content Between Two Texts

Step 1: Enter the Feature for Deleting Text in Folder Names

Open HeSoft Doc Batch Tool , and in the left feature category, select "Folder Name". After entering the corresponding tool list, find and click "Delete Text in Folder Name". The purpose of this step is to enter the operation interface specifically for processing characters in folder names, rather than deleting the folders themselves.

image-Batch delete the middle content of folder names,batch modify folder names,delete characters between two texts,batch rename folders

From the interface, it can be seen that the "Folder Name" category also provides tools such as find and replace, insert text, add prefix and suffix, and case conversion. This article deals with the variable content between two boundaries in the name, so "Delete Text in Folder Name" should be selected. Do not mistakenly choose file deletion or file organization features.

Step 2: Add Folders That Need Batch Renaming

After entering the feature page, you will initially stay at the "Select records to process" step. Click "Add Folder" in the upper right corner to add the folders to be processed to the task list. After adding, the table will display information such as serial number, name, path, creation time, and modification time.

image-Batch delete the middle content of folder names,batch modify folder names,delete characters between two texts,batch rename folders

In the screenshot, 10 folders were added at once, and the bottom of the page shows "Record count: 10". Before proceeding to the next step, you should carefully check the names and paths to confirm that all items indeed belong to this task. If a record was added by mistake, you can use the delete icon on the right side of that record to remove it from the current task list; if you need to reselect, you can also use "Clear" on the interface and then add again. What is removed here is the task record, and the purpose is to adjust the pending list.

After confirming that everything is correct, click "Next" to enter the processing rule settings page. The advantage of batch operations is that the rule only needs to be configured once, and multiple folders in the list can be processed according to the same logic, without having to open File Explorer repeatedly to rename each one.

Step 3: Select "All Content Between Two Texts"

On the "Set processing options" page, the software provides various operation types such as all digits, all Chinese characters, all English letters, a certain number of characters from the far left or far right, content to the left or right of a certain text, and position ranges. In this example, the deletion range needs to be determined by two fixed markers, so select "All content between two texts".

image-Batch delete the middle content of folder names,batch modify folder names,delete characters between two texts,batch rename folders

After selecting this type, you need to fill in two required fields:

  1. In the "Left text" input box, enter START.
  2. In the "Right text" input box, enter _END.

The left and right texts should be entered exactly according to the actual characters in the original folder names. English letter case, underscores, spaces, and numbers can all affect matching results. For example, if the original name is "START_tempFiles_END", the right boundary is preceded by an underscore, so the screenshot shows "_END" rather than just "END". Entering boundary characters accurately can make the deletion range match expectations.

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

The settings page provides separate switches for "Include left text" and "Include right text". In the screenshot, both switches are off, meaning that only the content between START and _END will be deleted, while START and _END themselves will not be deleted.

Therefore, "Project_START_alpha_END_Report" will become "Project_START_END_Report". If the task goal is to remove the boundary markers as well, you need to adjust the corresponding switches according to actual requirements. However, whether the boundaries are included will directly change the final name, so before batch execution be sure to clarify the goal and verify with a small number of samples.

Step 5: Continue Settings and Start Batch Processing

After completing the rule settings, click "Next". The interface flow also includes stages such as "Set save location" and "Start processing". Continue following the page prompts to complete the settings and execute the task. Since this operation targets folder names, before officially starting, confirm again the number of items to process, the left and right texts, and the boundary switch status.

After processing is complete, return to the folder location and check whether the names have changed from "START_middle content_END" to "START_END". It is recommended to prioritize checking several samples with different middle content, such as numeric fields, long text fields, and plain English text, to confirm that the unified rule has taken effect correctly.

FAQ and Precautions

1. Why did some folders not change?

A common reason is that the folder name does not contain both the entered left text and right text at the same time, or the characters are not exactly the same. For example, if START is written as Start, or the underscore before _END is missing, the actual name will not match the rule. You can first copy the boundary characters from the original name and then paste them into the settings box to reduce manual input errors.

2. If the middle content differs, can it be placed in the same batch task?

Yes. This feature locates the deletion range based on the left and right boundaries, and the middle content does not need to be consistent. Whether the middle is tempFiles, 2024Draft, batch001, or text of other lengths, as long as it is between the two specified texts, it can be processed by the same rule.

3. Will Word, Excel, or PDF files inside the folders be deleted?

This article uses the name processing feature under the "Folder Name" category, and the operation target is the folder name. Normal renaming is not the same as deleting the doc, docx, xls, xlsx, ppt, pptx, or PDF documents inside the folder. However, if other programs, shortcuts, or scripts depend on the original path, changing the folder name will also change its access path, so path impact should be evaluated first for important business directories.

4. Should the left and right texts themselves be preserved?

It depends on the naming convention. The screenshot example requires preserving START and END, so both "Include" switches are off. If you want to delete the entire "START_middle content_END" segment, you need to include boundary inclusion in the rule design. It is recommended to test with copies or a small number of folders first, and do not directly process the only copy of important directories before confirming the effect.

5. What else should be checked before operation?

It is recommended to check whether names are duplicated. After deleting the middle text, two originally different folders may become identical, creating a duplicate-name risk. For example, if two folders are distinguished only by a middle batch number, they may lose uniqueness after the batch number is removed. Also confirm that the folders are not occupied by other programs, and keep backups or a name list for important directories.

Summary

The core steps for batch deleting content between two specified texts in folder names are: enter the "Folder Name" category, select "Delete Text in Folder Name", add the folders to be processed, set the operation type to "All content between two texts", and then accurately fill in the left and right boundary texts. If you only want to delete the middle field, keep "Include left text" and "Include right text" off.

Compared with renaming one by one, HeSoft Doc Batch Tool can turn repetitive operations into a single rule configuration, and is especially suitable for project archiving, shared drive organization, and historical data migration. In actual use, it is recommended to first select a small number of folders to test the processing results, confirm that the boundaries, underscores, and preservation rules are correct, and then add the complete directory to the task and start batch processing.


Keyword:Batch delete the middle content of folder names , batch modify folder names , delete characters between two texts , batch rename folders
Creation Time:2026-10-12 22:38:52
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.