How can I batch remove text within a specified range from a large number of folders? A method to delete content based on left and right keywords.
Translation:EnglishFrançaisDeutschEspañol日本語한êµì–´ï¼ŒUpdate Time:2026-10-12 22:39:43
If a large number of folder names contain two fixed keywords, and the content between the two keywords needs to be removed uniformly, batch renaming can be completed through range positioning rules. This article uses START and _END as the left and right boundaries to demonstrate the complete operation of HeSoft Doc Batch Tool : enter the folder name function, add and check records, select all content between two texts, set whether to include boundaries, and then complete subsequent processing. It also explains risks such as special characters, duplicate names, and business path changes.
When batch-organizing folders, the most troublesome situation is often not deleting a completely identical string of text, but deleting text that is in the same position yet differs in content. For example, a group of directory names all contain START and END, but between the two markers they respectively contain branch names, temporary versions, batch numbers, or notes. Because these fields have inconsistent lengths, simple fixed-character deletion or word-by-word replacement is not efficient enough.
The folders in the example include "Backup_START_tempFiles_END_Final", "Data_START_sampleChunk_END_Clean", "Project_START_alpha_END_Report", and so on. What the user really needs is a general rule: find START as the left boundary, find _END as the right boundary, and clear all characters between the two in one pass, while keeping the valid parts before and after the name.
For this kind of repetitive office task, you can use HeSoft Doc Batch Tool . It is an office software for batch processing documents, files, and folders, capable of turning manual renaming into repeatable rules. This article will expand on applicable conditions, processing results, specific steps, and risk checks to help users complete unified cleanup of a large number of folder names.
Applicable scenarios: deleting by left and right keywords is more suitable than character-by-character replacement
"All content between two texts" is suitable for handling folder names with stable boundaries but changing content in the middle. Common applications include:
- Delete development branches, internal codenames, and test environment names in project directories.
- Clear temporary numbers, handover notes, or draft years in customer folders.
- Remove process fields such as raw, sample, and oldVersion from directories of images, design drafts, and video materials.
- When organizing financial invoices or contract directories, remove batch numbers and handling notes.
- Unify the naming of directories migrated from servers, old computers, or backup drives.
The difference between this method and ordinary find-and-replace is that find-and-replace usually requires the text to be replaced to be explicit and identical, while deletion by left and right keywords only requires the boundaries to be consistent. Whatever is in the middle, whether English letters, numbers, or longer combinations, can be cleared as a range.
Taking this example, tempFiles and 2024Draft are not the same and have different lengths, but they are both located between START and _END. Therefore, you only need to configure the left and right text once, without building ten replacement rules for ten folders.
Result preview: what is kept after clearing the range text
Before processing: folder names contain different temporary fields
The image below shows the names before batch processing. The red-marked area is the variable content to be deleted, and to its left START can always be found, while to its right END can always be found.

The names before processing include both English structures such as "Backup_START_tempFiles_END_Final" and combinations of numbers and letters such as "Client_START_2024Draft_END_Archive". If each name were manually renamed one by one, the user would need to repeatedly locate the start and end points in each name, and any slight oversight could delete Final, Archive, Clean, and other status fields that should be retained.
After processing: the middle content disappears, while the information before and after is retained
After processing is completed, all variable fields are cleared, and the names uniformly become the form "front_START_END_back".

For example:
- Backup_START_tempFiles_END_Final is processed into Backup_START_END_Final;
- Design_START_oldVersion_END_Approved is processed into Design_START_END_Approved;
- Invoice_START_batch001_END_Paid is processed into Invoice_START_END_Paid;
- Task_START_removeThis_END_Done is processed into Task_START_END_Done.
START and END are not deleted here because neither of the two "include" switches in the example is enabled. That is, START and _END are only used to determine the range and are not themselves part of the deletion target.
Operation steps: batch-delete ranges in folder names by left and right text
Step 1: Select the folder name processing function
Open HeSoft Doc Batch Tool , and in the left column click "Folder Name". Then in the main area find "Delete Text in Folder Name" and enter it.

Here you should distinguish between "folder name" and "file name". The goal of this article is to modify the names of the directories themselves, so choose the folder name category. The software's main interface also provides entry points for Word tools, Excel tools, PowerPoint tools, PDF tools, text tools, and other office processing functions, but they are not the objects of this task.
After entering "Delete Text in Folder Name", the page will guide the user through the process of selecting records, setting options, setting the save location, and starting processing. Following the steps helps complete object and rule verification before formal modification.
Step 2: Add folders and build a processing list
Click "Add Folder" in the upper-right corner of the page to add the directories to be processed to the list. The software will display information such as folder name, path, creation time, and modification time.

The example list contains 10 records in total. In batch tasks, building a clear object list is very important, because the same processing rule will be applied to multiple records in the list. It is recommended to confirm the following item by item:
- Whether the paths are correct, especially distinguishing test directories, backup directories, and formal business directories.
- Whether all names contain the planned left and right keywords.
- Whether any ordinary folders that do not match the structure have been mixed in.
- Whether the expected names after processing may duplicate existing directories.
If records that do not need to be processed have been added, you can use the delete icon on the right side of each row to remove them. If the entire list is selected incorrectly, you can use "Clear" to add again. After confirming the list, click "Next" to enter rule configuration.
Step 3: Select the operation type for range deletion
On the "Set Processing Options" page, select "All Content Between Two Texts". Do not select "All English Letters" or "All Numbers", because these types may delete characters before or after the name that originally need to be retained; also do not select a fixed position range, because in this example the lengths of the middle fields are inconsistent.

Range deletion defines the scope using two positioning texts on the left and right. According to the example, fill in:
- Left text: START
- Right text: _END
When entering the text, the underscore should be treated as part of the name. Hyphens, underscores, spaces, parentheses, and other characters in folder names are all real characters, and missing or extra characters may change the matching range. The safest way is to confirm the complete boundary spelling from the original name before filling it in.
Step 4: Confirm whether the boundaries are within the deletion range
Below the left text and right text there are settings for "Include left text" and "Include right text" respectively. They determine whether the positioning text is also deleted when the middle content is deleted.
The example expects to obtain "Backup_START_END_Final", so both switches remain off. After execution, only the characters between START and _END are cleared. If START or END were also included in the deletion range, the result would differ from the screenshot.
In actual business, you can first write out the target result and then infer the switch states. For example, if the goal is to keep "START_END", then the boundaries should not be included; if the goal is to completely remove the entire marker segment, then you need to re-evaluate whether the boundaries and adjacent underscores should also be deleted. Before batch processing, one or two test directories should be used for verification, rather than configuring based only on intuition.
Step 5: Complete subsequent settings and start processing
After confirming the parameters, click "Next" to continue to the subsequent process. According to the step indicators at the top of the interface, the following steps include "Set Save Location" and "Start Processing". Complete the settings according to the page prompts, and before starting, confirm again the number of task records and the deletion rule.
After processing is complete, open the corresponding directory to verify the results. It is recommended not to check only one record, but to check separately:
- Folders whose middle content is pure English;
- Folders whose middle content contains numbers;
- Folders with longer middle text;
- Folders at the beginning and end of the list.
Through multi-sample verification, problems such as incorrect boundary character input, inconsistent partial name structures, or duplicate names can be discovered more quickly.
Common questions and precautions
1. What happens when there is no content between the left and right text?
If a folder is already in the START_END structure, it no longer contains a middle field that needs to be cleared. Whether to include such directories in the task should be determined according to the actual situation. To make the task list easier to check, it is usually recommended to add only the records that actually need to be processed.
2. Can it still be processed if the middle contains Chinese characters or numbers?
This rule focuses on the left and right boundaries, not the type of characters in the middle. Therefore, the middle can contain English letters, numbers, Chinese characters, or combined text. The premise is that the name can be stably located by the left and right text. If some names lack one boundary, they should first be organized separately.
3. Why can't all English letters simply be deleted?
Because valid fields before and after the name, such as Backup, Final, Project, and Report, are also composed of English letters. If you choose to delete all English letters, the processing scope will be expanded. Using two texts to determine the range can clear only the target position while preserving other business information.
4. Will batch renaming affect internal files?
Modifying folder names usually does not rewrite the contents of Word, docx, doc, Excel, xlsx, PDF, image, or video files inside them, but the full paths will change. If office documents contain external links, Excel workbooks reference the old directories, or other software has saved absolute paths, these references may need to be updated after the folder is renamed.
5. What should be done if duplicate names appear after deleting the middle fields?
This is the issue that most needs to be checked in advance during batch cleanup. Suppose two folders differ only between START and END; after deleting that field, they may end up with exactly the same name. Before starting processing, list the expected results and make sure each name remains unique. If necessary, keep part of the number, or first add distinguishable prefixes or suffixes.
6. What should be done if the left and right boundaries appear repeatedly in the same name?
When a name contains multiple START or multiple END occurrences, the deletion range may not be as intuitive as with a single set of boundaries. It is recommended to remove such special records from ordinary tasks and create a separate test task. Only after confirming the actual matching range is it appropriate to expand the processing quantity.
7. How can the risk of batch processing be reduced?
First back up important directories or keep the original name list; second, test with a small number of copies; then confirm underscores, spaces, and capitalization; finally check for duplicate names after processing. Although renaming folders does not equal deleting data, path changes may affect collaboration workflows, so for formally shared directories an appropriate processing time should also be chosen.
Summary
When a large number of folder names share the structure "left keyword + variable content + right keyword", locating by two texts and deleting the middle range is more efficient than renaming one by one or performing find-and-replace item by item. The example in this article uses START as the left text and _END as the right text, and turns off both include switches, ultimately clearing only the middle content while preserving START, END, and the parts before and after the name.
HeSoft Doc Batch Tool can add multiple directories to the same list and process them centrally with one set of rules, thereby reducing repeated clicks and manual input. It is recommended to first select a small number of representative folders for testing, confirm that the processing result is the "START_END" structure, and then import the complete directories for batch execution. This can improve file organization efficiency while reducing the probability of incorrect or missed modifications.
Keyword:Batch remove specified range from folder names , delete text based on left and right keywords , batch folder renaming software , batch delete name content