How to batch remove the middle part of folder names? Tutorial on deleting content by start and end markers
Translation:EnglishFrançaisDeutschEspañol日本語한êµì–´ï¼ŒUpdate Time:2026-10-12 22:41:39
Project folders often contain draft markers, internal numbers, old version information, and temporary notes. If these contents are located between fixed start and end markers, there is no need to search item by item and manually rename them. This article uses START and _END as boundaries to demonstrate how to import multiple folders through HeSoft Doc Batch Tool , set interval deletion conditions, retain the left and right markers, and output results in batches. It also explains practical considerations such as underscore matching, filtering special directories, duplicate boundaries, and testing before formal processing.
In team collaboration and daily office work, folder names often accumulate additional information as projects move forward. For example, designers may add oldVersion, developers may mark debugInfo or alpha, and archive staff may write batch descriptions such as 2024Draft and batch001. After the project ends, these intermediate fields are no longer useful, but the business category at the beginning of the folder name and the archival status at the end still need to be retained.
If there are many folders, manually deleting the intermediate fields from their names creates a large amount of repetitive work. What is more troublesome is that the specific text to be deleted is not exactly the same in each directory, so ordinary word-based find-and-replace is difficult to cover all cases at once. The solution is not to list the content to be deleted one by one, but to identify their common start and end markers, and then batch-delete all text between the two markers.
This article uses HeSoft Doc Batch Tool for demonstration. This is a software tool for batch processing office files and folders, suitable for centrally executing well-defined, high-volume organization tasks. In the example, START is used as the starting text and _END as the ending text, ultimately retaining the two markers while clearing the variable fields sandwiched between them.
Applicable scenario: cleaning middle fields in names by start and end markers
Removing draft and version information from project directories
Project materials often use the structure of "project name + start marker + version information + end marker + current status". Version information may change every day, but the start and end markers remain fixed. After archiving is complete, content such as Draft, alpha, and oldVersion can be deleted at once, making directory names more consistent.
Batch removal of batch numbers, test markers, and internal notes
In orders, invoices, customer materials, and test data, fields such as batch001, sampleChunk, privateText, and rawSet are common. These contents vary in spelling and length, so searching for them one by one is not efficient. If they are located between uniform delimiters, deleting by text range is more direct.
Organizing a repository containing multiple types of office files
A folder may contain docx, doc, xlsx, xls, pptx, ppt, PDF, and images at the same time. The operation in this article only changes folder names and does not require the internal files to use the same format. Therefore, it is suitable for unified naming organization of comprehensive office repositories, client delivery directories, project archive drives, and department shared directories.
Cases where this approach is not directly applicable
If folder names have no fixed boundaries, or if each name uses completely different delimiters, then it is not appropriate to directly use the same set of start and end texts. In this case, the names should first be grouped according to their naming structure, and then rules should be set separately. Batch processing pursues uniformity and efficiency, but the premise is that the input records meet the same conditions.
Effect preview: from complex names to a unified structure
What common patterns do the names have before processing
There are 10 folders in the screenshot before processing. Although the middle field of each name is different, the overall structure is consistent: the front part contains business names such as Backup, Build, Client, Data, and Design; the middle part contains START and _END in every name; and the end contains statuses such as Final, Release, Archive, Clean, and Approved.

For example:
- Build_START_debugInfo_END_Release
- Data_START_sampleChunk_END_Clean
- Design_START_oldVersion_END_Approved
- Notes_START_privateText_END_Public
- Task_START_removeThis_END_Done
What needs to be cleared are _debugInfo, _sampleChunk, _oldVersion, _privateText, and _removeThis respectively. They do not share a unified text, so a single fixed word cannot be used for simple replacement; however, they are all located between START and _END, so they can be identified by range.
Unified result after processing
After the batch modification is completed, all variable fields have disappeared. Taking "Build_START_debugInfo_END_Release" as an example, it becomes "Build_START_END_Release" after processing; "Task_START_removeThis_END_Done" becomes "Task_START_END_Done".

From the screenshot, it can be seen that the business name, START, END, and the ending status are all retained. The change occurs only between the two specified texts, indicating that the rule did not expand to other areas of the names. This processing method is especially suitable for scenarios where the naming framework needs to be preserved and only a certain field range needs to be cleaned.
Operation steps: creating a range deletion rule for folder names
Step 1: Select text deletion under the folder name category
After starting HeSoft Doc Batch Tool , first select "Folder Name" on the left side. After entering this category, the main area will display multiple folder naming tools. Select "Delete text from folder names" to enter this batch task.

Choosing the correct function is very important. "Delete text from folder names" targets directory names, not deleting files inside folders, nor clearing the body text in Word, Excel, or PDF files. Before entering the function, the processing target should be clarified to avoid selecting the wrong tool category.
Step 2: Import folders under the same naming rule
The first stage of the function page is "Select records to process". Click "Add Folder" in the upper right corner to add the directories to be renamed to the table. The list will display the name, path, creation time, and modification time of each record, making it convenient to verify before processing.

The records in the screenshot are located under the same test path, with a total of 10. At this point, do not rush to the next step; instead, focus on checking the following:
- Whether START and _END both exist in every name.
- Whether the prefixes and suffixes to be retained are complete.
- Whether any official directories that should not be modified have been mixed in.
- Whether the case, underscores, and spaces of the boundary text are consistent.
If a record should not be included in the processing, use the delete icon in that row's operation area to remove it from the task. If the entire batch of directories was selected incorrectly, use "Clear" and then add them again. After confirming the records, click "Next" at the bottom of the page.
Step 3: Choose deletion based on content between two texts
After entering the "Set processing options" stage, select "All content between two texts" under operation type. This option is different from methods such as deleting all numbers, deleting all Chinese characters, or deleting the leftmost few characters. It does not delete based on character type or fixed length, but uses two texts on the left and right to locate the range.

Fill in the following parameters according to the example:
- Left text: START
- Right text: _END
- Include left text: Off
- Include right text: Off
After the settings are completed, the software will find START and _END and delete the content between them. Both include switches are turned off, meaning the boundaries are used only for positioning and are not part of the deletion target.
Step 4: Determine whether to include boundaries based on the target result
The difficulty in parameter settings usually lies not in entering START or END, but in determining which part the underscore belongs to and whether the boundaries themselves need to be retained. The original name in this example is "Backup_START_tempFiles_END_Final", and the target name is "Backup_START_END_Final". To obtain this result, START should be entered on the left and _END on the right.
The right-side condition includes an underscore here because the goal is to delete the underscore after START and tempFiles, while preserving the underscore in _END. In other words, the range to be deleted is "_tempFiles", and the right boundary starts from the second underscore. If only END were entered, the actual located range would change, and the final symbol combination in the name might not meet expectations.
The two include options must also remain off. If the left text is included in the deletion range, START may be removed as well; if the right text is included, _END may also be deleted. These options should be enabled only when the actual goal is to delete the entire segment including the start and end markers.
Step 5: Continue to set the save location
After confirming the deletion conditions, click "Next". The process display at the top of the page shows that after processing options comes "Set save location". At this stage, the result location or save arrangement should be determined according to the actual prompts in the software interface. For important office materials, it is recommended to prioritize a solution that is convenient for verification, and not to directly process the only original directory before testing the rules.
After completing the save settings, proceed to "Start processing" in the workflow. Before running, you can go back and check to ensure that the folder records, left and right texts, and include options are all correct.
Step 6: Start processing and verify the results
After executing the batch task, go to the result location to check the folder names. When verifying, do not look only at the first record; it is recommended to check multiple directories at the beginning, middle, and end of the list to confirm that fields of different lengths have all been cleared.
The expected result should meet three conditions: first, the content before START remains unchanged; second, the text between START and _END is deleted; third, the status field after _END continues to be retained. If all three conditions are met, the range deletion rule is set correctly.
Frequently asked questions: what is easy to overlook when batch-deleting name text
Why can't we simply find tempFiles and replace it with nothing
Finding fixed text is only suitable when all folders contain the same word to be deleted. In this example, the middle content of each record is different. If replacement rules were created one by one, the number of operations would increase with the number of folders. Locating the range by two markers does not care what exactly is in the middle, making it more suitable for batch-clearing dynamic fields.
Do START and _END need to be case-sensitive
To ensure accurate matching, they should be entered according to the actual form in the folder names, including letter case, underscores, hyphens, and spaces. If START, Start, and start all exist in the list at the same time, it is recommended to test them in groups first rather than assuming they will be treated as the same text.
What happens if _END is missing from a name
A name missing either boundary does not have a complete range and cannot be accurately located according to the example rule. The safest approach is to filter after adding records, moving directories that lack boundaries, have misspelled boundaries, or have different structures out of the current task, and then process them separately.
What if there are multiple identical boundary pairs in one name
If START or _END appears multiple times within the same folder name, multiple matchable ranges may be formed. Because the screenshot does not show the specific matching method when boundaries are repeated, the processing result should not be assumed directly. It is recommended to first copy a representative directory for small-scale testing, and only after confirming that the range selected by the software meets the requirements should batch execution be performed.
Is it normal to have consecutive underscores after processing
Whether consecutive symbols appear depends on how the boundary text is written. In the example, the processed result is displayed as START_END, which is the expected structure. If your goal is to make the two side texts connect directly, or to keep only one separator, then you need to reanalyze whether the underscore belongs to the left boundary, the deletion range, or the right boundary, and adjust the input accordingly.
Will batch renaming affect documents inside folders
Judging from the function name and operation target in this case, what is processed is the folder name, not the body text of internal doc, docx, xls, xlsx, pptx, or PDF files. However, some shortcuts, program configurations, spreadsheet links, or scripts may depend on the original directory path. Renaming folders changes the path, so when external references are involved, it should be evaluated in advance and a backup should be retained.
Practical suggestions for improving the accuracy of batch organization
Before formally processing a large number of directories, you can first copy 3 to 5 representative folders from the complete data, including samples with longer middle text, shorter middle text, numbers, and English. After executing with the same rules, observe whether all results are correct. Small-sample validation can help discover problems in advance, such as missing an underscore in a boundary or incorrect settings for the include options.
If the directories to be organized have multiple naming methods, they can be processed in batches according to boundary structure. For example, directories using START and _END can be one batch, while directories using BEGIN and _FINISH can be another batch. Applying only one set of clear rules to each batch is more reliable than importing all directories at once.
In addition, original names can be recorded before execution to facilitate later verification. For important projects, backups should be retained, especially when folder paths are already referenced by other office documents, automation scripts, or collaboration systems.
Summary
When many folder names contain different temporary fields, and those fields are located between fixed start and end markers, batch deletion by range is more efficient than searching and replacing one by one. The example in this article locates the range through START and _END, and turns off "Include left text" and "Include right text", successfully preserving the naming framework while clearing only the version, batch, or note information in the middle.
HeSoft Doc Batch Tool organizes adding folders, setting rules, arranging saving, and starting processing into a clear workflow, suitable for reducing mechanical operations in office material organization. In actual use, it is recommended to first check the naming patterns, then test with a small number of copies, and finally import the complete directories for batch execution. This not only saves the time of renaming items one by one, but also reduces the risk of inconsistent names and missed modifications when multiple people are organizing files.
Keyword:Batch clear middle field of folder names , delete text by start and end markers , batch rename folders , batch delete specified ranges in names , batch organize office files