How to batch delete content between two specified texts in folder names


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-12 22:41:22
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 version numbers, project codenames, internal notes, or other fields that are no longer needed, renaming them one by one is both time-consuming and prone to errors. This article explains how to use the batch folder name processing feature in office software, specify left and right boundary text, and delete all content between two pieces of text in one go while preserving the boundary markers and other parts of the name. It also illustrates specific settings combined with before-and-after effects, complete operation steps, and precautions.

When organizing project materials, customer archives, or archived files, you often encounter a class of folder names with similar structures: the parts before and after the name need to be preserved, while the middle contains version numbers, batch numbers, internal notes, or temporary descriptions. For example, the folder name is "Backup_START_tempFiles_END_Final", and the only part that really needs to be deleted is "_tempFiles" between "START" and "_END". If there are only two or three folders, manual modification is not difficult; but when faced with dozens or even hundreds of directories, renaming them one by one not only consumes time but may also lead to missed deletions, excessive deletions, or inconsistent separators.

In this case, you can use HeSoft Doc Batch Tool to batch rename folders. It is a batch processing software designed for office scenarios, capable of turning repetitive file and folder organization tasks into unified rule execution. This article will use the example of batch deleting all content between two specified texts in folder names to introduce the processing effect, parameter meanings, and complete operation process.

Applicable scenarios: which folder names are suitable for this processing

"Delete all content between two texts" is suitable for processing folder names that have fixed naming boundaries but constantly changing content between the boundaries. As long as the same left marker and right marker can be found in each name, a unified deletion rule can be established.

Cleaning up version numbers and temporary notes

In R&D, design, and operations materials, names such as "ProjectName_START_version note_END_status" often appear. The middle part may be oldVersion, alpha, debugInfo, or 2024Draft, but the left and right markers remain consistent. In this case, there is no need to search for each type of version text separately; simply specifying the two boundaries allows you to delete the constantly changing content between them.

Organizing customer, order, and archive directories

Customer materials may include internal numbers in folder names, order directories may carry batch numbers, and archive directories may also retain temporary fields added during migration. When these fields are located between two fixed texts, they can be batch cleaned up while preserving useful information such as customer names and archive status.

Unifying directories for images, Word, Excel, and other materials

This method processes folder names, so it is not affected by the format of the materials inside the folders. Whether the directory contains Word documents such as docx and doc, Excel spreadsheets such as xlsx and xls, or PDF, PPT, images, and audio/video files, you can first uniformly organize the names of their parent folders. The software modifies directory names this time, not the content of these documents.

Effect preview: changes in folder names before and after processing

Before processing: the middle text of each name is different

The following before-processing screenshot shows 10 folders to be organized. They all contain two recognizable boundaries, "START" and "_END", but the middle contents are tempFiles, debugInfo, 2024Draft, sampleChunk, oldVersion, batch001, privateText, rawSet, alpha, and removeThis.

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

Take several of these names as examples:

  • Backup_START_tempFiles_END_Final
  • Client_START_2024Draft_END_Archive
  • Invoice_START_batch001_END_Paid
  • Project_START_alpha_END_Report

If ordinary find-and-replace is used, separate rules need to be set for different contents such as tempFiles, 2024Draft, and batch001, which is clearly not suitable for a large number of directories. A more effective method is to use START as the left text and _END as the right text, allowing the software to automatically identify and delete all characters between the two.

After processing: variable content is uniformly removed

After batch processing, the left and right boundaries in the folder names are still preserved, while the temporary content in the middle is deleted. For example, "Backup_START_tempFiles_END_Final" becomes "Backup_START_END_Final", and "Client_START_2024Draft_END_Archive" becomes "Client_START_END_Archive".

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

From the after-processing screenshot, you can see that all 10 folders were renamed according to the same rule. The project category at the beginning of the name and the status information at the end such as Final, Release, Archive, Clean, and Approved were not changed, thus achieving targeted batch deletion.

Operation steps: batch delete content between two texts

Step 1: Enter the function for deleting text from folder names

Open HeSoft Doc Batch Tool , and select "Folder Name" in the function category on the left. The main interface will display tools related to folder naming, including find and replace, insert text, add prefix and suffix, case conversion, and delete text. In this case, you need to select "Delete text from folder names".

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

The purpose of this step is to enter the process specifically for handling folder names. Note that you should not mistakenly select the file name or document content processing function, because the object of this article is the name of the folder itself.

Step 2: Add the folders that need batch renaming

After entering the function page, you are currently at the "Select records to process" stage. Click "Add Folders" in the upper right corner of the page to add the directories to be processed to the list. In the screenshot, 10 records have already been added, and the table displays the serial number, name, path, creation time, and modification time, with the record count also shown at the bottom.

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

After adding, you should first check the names and paths to confirm that these directories do indeed follow the same naming rule. If folders that do not need to be processed are mixed into the list, you can remove them from the current task by clicking the delete icon on the right side of the corresponding record; if you need to reselect, you can also use "Clear" at the top of the page. The removal or clearing here is an adjustment to the current processing list and should not be understood as deleting the original folders on the disk.

After confirming that the list is correct, click "Next" at the bottom to enter the processing option settings.

Step 3: Select all content between two texts

On the "Set processing options" page, you can see various deletion methods, including all numbers, all whitespace, all Chinese characters, all English letters, the leftmost or rightmost few texts, all content to the left or right of a certain text, position ranges, and more. In this example, you should select "All content between two texts".

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

After selecting this operation type, you need to fill in the two boundaries:

  1. Left text: enter START.
  2. Right text: enter _END.
  3. Include left text: keep it off so that START itself is preserved.
  4. Include right text: keep it off so that _END itself is preserved.

According to the settings in the screenshot, the software only deletes the content after START and before _END, and does not delete these two boundary texts. Since the right condition filled in is "_END", which contains an underscore, the resulting continuous structure after processing is "START_END".

Step 4: Understand the difference between whether boundary texts are included

The two "include" options directly determine the deletion range, so you should clarify the target result before setting them. If both options are turned off, what is deleted is the content between the boundaries, and both START and _END will be preserved, which is exactly the solution shown in the screenshot.

If "Include left text" is enabled, the deletion range will also include the left boundary; if "Include right text" is enabled, the right boundary will also be included. If both are enabled, the entire segment from the left text to the end of the right text may be cleared. Different modes are suitable for different naming goals, so you should not execute based solely on the option names; it is recommended to verify with a small number of copies first.

Step 5: Set the save location and start processing

After completing the parameter settings, click "Next". According to the process shown at the top of the page, the subsequent steps are "Set save location" and "Start processing". In the saving stage, determine the save method or location for the processing results according to the interface prompts, and then enter the start processing stage after confirmation.

Before officially running the process, it is recommended to check three items again: whether the records to be processed are correct, whether the left and right boundaries are complete, and whether the two include options meet expectations. After processing is complete, open the target directory and spot-check several folders to confirm that the middle fields have been deleted and that the parts before and after the names are unaffected.

Common issues and precautions

Why the underscore must be entered accurately

Text matching is usually based on actual characters. "END" and "_END" are not the same boundary. In this example, the right side is "_END" so that the right underscore is included in the boundary and preserved. If the folders actually use hyphens, spaces, or other symbols, you should enter them according to the actual names and not mechanically copy the example.

Can the middle content of different folders be different

Yes. The value of this function lies in the fact that you do not need to know the middle content in advance. As long as the left and right boundaries can be recognized in the names, tempFiles, alpha, batch001, or other texts of different lengths can all be deleted according to the unified rule.

What to do with directories where boundary texts do not appear

If some folders lack the left or right text, they do not meet this rule. To reduce the risk of incorrect processing, it is recommended that after adding directories, you check the list first, move records with different naming structures out of the task, and create separate processing rules suitable for them.

How to handle cases where the left or right text appears multiple times

When the same boundary appears repeatedly in a name, the matching result may differ from expectations. Before formal batch execution, you should select such special names for separate testing and observe the actual results. For directories where the boundary is not unique, you can use more complete and more distinguishable texts as conditions instead.

Do you need a backup before batch renaming

Folder names are often referenced by shortcuts, scripts, project configurations, or other documents. Even if the renaming rule itself is correct, changing the name may affect external references. Therefore, important business materials should be backed up first, or you can copy a small number of directories for testing first, and expand the processing scope only after confirming that the results and subsequent use are normal.

Summary

The key to batch deleting content between two texts in folder names is to find stable left and right boundaries and correctly decide whether to delete the boundaries together with the content. The example in this article uses START and _END as conditions and turns off both include options, thereby clearing only the temporary fields in the middle and preserving other valid parts of the folder names.

With HeSoft Doc Batch Tool , you can turn the repetitive labor of renaming folders one by one into a process of adding them once, setting unified rules, and executing in batch. It is recommended to first organize a group of folders with consistent naming structures, verify the rules using a small number of copies, and after confirming that the before-and-after effects meet expectations, run batch processing on the complete directory to improve file organization efficiency more reliably.


Keyword:Batch delete folder name text , batch modify folder names , delete content between two texts , batch rename folders , batch process folders
Creation Time:2026-10-12 22:41:05
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.