What should I do if the folder name is too long? Batch clear characters between two markers
Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-13 07:06:38
Folder names often accumulate debugging information, draft versions, batch numbers, and internal notes, making directories overly long and difficult to navigate. If these variable characters are located between two fixed markers, they can be removed in one pass using boundary rules. This article uses START and _END as examples to explain how to add multiple folders in HeSoft Doc Batch Tool , select "all content between two texts", decide whether to keep the left and right markers, and complete saving and processing. The article also explains common risks such as match failures, name conflicts, and path references.
Folder names are often too long not because there is genuinely a lot of information that must be retained, but because temporary versions, debugging states, batch numbers, and processor notes are continuously added during naming. After a project ends, this process information loses its value, yet it remains embedded in the formal name. For example, the debugInfo in "Build_START_debugInfo_END_Release", or the oldVersion in "Design_START_oldVersion_END_Approved". Manual deletion is straightforward, but when similar directories are spread across dozens of projects, repeated renaming becomes inefficient and error-prone.
If the characters to be deleted have stable markers on both sides, left and right boundaries can be used to locate them without listing every piece of content in between. This article explains how to use HeSoft Doc Batch Tool to batch remove characters between two markers in folder names. This product is a batch processing tool for office files, and its core value lies in uniformly executing a large number of identical operations, making it suitable for folder name organization, batch file renaming, and daily archiving of office materials such as Word, docx, doc, Excel, xlsx, and PDF files. This article only demonstrates folder name processing and will not modify the content of documents inside the folders.
1. Which long folder names are suitable for boundary-based cleanup
Not all long names are suitable for direct shortening. The prerequisite for using "delete all content between two texts" is that the name contains clear left text and right text, and that the information to be removed lies exactly between them.
- Software build directories: names containing temporary notes such as debugInfo, tempFiles, rawSet.
- Project version directories: names containing stage markers such as 2024Draft, oldVersion, alpha, which are no longer needed when archiving.
- Business batch directories: names containing batch numbers such as batch001 and batch002, which need to be uniformly converted into simplified formal names.
- Internal-to-external material conversion: directories containing internal fields such as privateText and removeThis, which need to be cleared before sharing.
- Status-based archiving: when you want to keep the object type at the front of the name and statuses such as Final, Release, Archive, or Approved at the end, and only clean up the process information in between.
The advantage of this method is that the middle characters can vary. As long as all names to be processed use the same boundaries, the software can apply a unified rule based on the structure. Therefore, it is more suitable for batch renaming folders than performing separate find-and-replace operations for each version number.
2. Effect before processing: dynamic characters sandwiched between fixed markers
The screenshot below shows 10 folders before processing. Their business prefixes and ending statuses differ, but all contain the two markers START and _END. The area marked by the red line is the dynamic content to be deleted.

These names can be abstracted into a unified structure:
Name prefix + START + characters to delete + _END + name suffix
For example, in "Invoice_START_batch001_END_Paid", the name prefix is Invoice_, the left text is START, the characters to delete are _batch001, the right text is _END, and the name suffix is _Paid. When actually setting the boundaries, you should determine whether underscores belong to the boundaries or to the deletion range based on the desired result. In the screenshot settings, the left text is set to START and the right text is set to _END, so the content after START and before _END will be deleted.
Because tempFiles, debugInfo, 2024Draft, and batch001 are not the same, a single keyword replacement cannot complete all tasks at once. The left-right boundary rule only cares about "where to start and where to end", which better fits this naming structure.
3. Effect after processing: preserving the main name and markers on both sides
After processing is complete, the dynamic characters in the middle have disappeared, and the folder names have been shortened into a consistent structure.

Some before-and-after changes are as follows:
- Backup_START_tempFiles_END_Final → Backup_START_END_Final
- Client_START_2024Draft_END_Archive → Client_START_END_Archive
- Invoice_START_batch001_END_Paid → Invoice_START_END_Paid
- Photo_START_rawSet_END_Edited → Photo_START_END_Edited
- Task_START_removeThis_END_Done → Task_START_END_Done
From the results, it can be seen that START and the END within _END are preserved, while the temporary notes in between are removed. The business prefix and ending status of the folder names remain unchanged. Such names are shorter, tidier, and easier to browse and sort quickly in File Explorer.
4. Detailed operation steps
Step 1: Select the folder name category
After launching HeSoft Doc Batch Tool , find "Folder Name" in the left navigation bar. After entering this category, the main interface will show multiple functions related to folder naming, including find and replace, insert text, add prefix or suffix, case conversion, and delete text. For this article, select "Delete text in folder names".

Selecting the correct function here is very important. "Find and replace" is usually suitable for known and completely identical keywords, but in this article the middle content of each folder is different, so you need to use the boundary-based positioning method in the delete text tool. After entering it, the page title will also show "Delete text in folder names", which can confirm that you have not selected the wrong option.
Step 2: Build the list of folders to be processed
In Step 1, "Select records to process", click "Add Folder" to add the directories whose names need to be shortened to the task. After adding, the software will list the name, path, creation time, and modification time in a table.

In the example, the summary area shows the record count as 10. Before setting the rules, check the following item by item:
- Whether all folder names contain START and _END.
- Whether the paths belong to the intended test directory or formal working directory.
- Whether the list accidentally includes shared directories, program directories, or other unrelated directories that cannot be renamed.
- Whether two records may end up with the same name after deleting the middle characters.
For any individual record that should not be processed, click the delete icon in the action column of that row to remove it from the current list. If you need to rebuild the list, you can use "Clear". After confirming that the records are correct, click "Next". This step is equivalent to determining the batch processing scope. The more carefully the scope is checked, the safer the subsequent batch execution will be.
Step 3: Define the deletion range using left and right text
After entering Step 2, "Set processing options", select "All content between two texts" under "Operation type". Then set the boundaries in the required input fields:
- For "Left text", enter: START
- For "Right text", enter: _END

The boundaries here are not ordinary keywords to be directly replaced, but positioning markers used to identify the deletion range. The software will find the left text in the folder name, then find the right text after it, and treat the characters between the two as the target content.
In the screenshot, both "Include left text" and "Include right text" are not enabled. This means that START and _END themselves are not included in the deletion range, so the final result still shows START_END. If "Include left text" is enabled, the left boundary may also be cleaned up together with the target range; if the right-side switch is enabled, the right boundary will also be included in the processing. The specific result should be subject to the rules and actual testing in the software interface. To obtain the results shown in this article, keep both switches off.
Step 4: Verify the rule with one name
Before continuing to the next step, you can manually verify the settings with a folder name. Take "Data_START_sampleChunk_END_Clean" as an example:
- Find the left text START.
- Find the boundary _END to its right.
- Delete the content between START and _END.
- Both "include" switches are off, so START and _END are preserved.
- The expected result is Data_START_END_Clean.
If the deduced result matches the target, the boundary settings are basically correct. If you want to get Data_Clean instead, then the current rule and switches do not meet the goal, and you need to replan the boundaries or whether to include them. Through this kind of paper-based deduction, most setting problems can be discovered before batch execution.
Step 5: Confirm the save location and start processing
After clicking "Next", follow the top workflow to enter "Set save location". Determine the location for the processing result according to the options actually provided in the interface, and pay special attention to avoid mixing test results with formal materials. Then enter "Start processing" and execute the batch task.
During processing, avoid manually renaming files in File Explorer at the same time, and do not let other programs keep occupying the target directories. After the task is complete, return to the target location to check whether the number of folders remains consistent, whether the names have been shortened according to the rules, and confirm that the original materials inside the folders can still be accessed normally.
5. How to fill in the boundary text
1. Choose markers that are stable and sufficiently distinctive
START and _END are used in the sample names to mark the range, so they are relatively easy to identify. In actual work, you can use fixed prefixes, fixed suffixes, or agreed-upon separator text. However, if the boundaries are too common, they may match other positions in the name. For example, using only a single letter as a boundary is less reliable than using a complete marker.
2. Do not ignore underscores, spaces, and hyphens
"END", "_END", and "-END" are not the same text. The example uses _END as the right boundary so that the result forms START_END. If you mistakenly enter END, the way adjacent underscores are retained within the deletion range may change. Before setting, directly observe the character structure of the original name.
3. Process multiple naming structures in batches
If some folders use START..._END while others use BEGIN..._FINISH, do not force a single set of boundaries to complete all tasks. Group them by naming structure and create separate batch tasks, which makes it easier to obtain predictable results.
6. Common problems and risk warnings
Why do some names fail to match?
Possible reasons include missing left text or right text, incorrect boundary order, inconsistent capitalization, extra spaces in the name, or the use of symbols that look similar but are actually different. It is recommended to copy the name to a location where the characters can be clearly identified for verification.
What if START or _END appears multiple times in a name?
When boundaries appear repeatedly within the same name, the actual matched range may not match your intuition. For such records, test them individually first, and do not directly batch-process them together with ordinary names. If necessary, choose more unique boundary text.
What if duplicate names occur after deletion?
If two folders differ only in the dynamic characters in the middle, they may end up with the same name after deletion. For example, two directories in the same path contain batch001 and batch002 respectively; after removing the batch numbers, the remaining names are exactly the same. Before execution, create a result list or process them in batches to avoid name conflicts.
Does it matter if a directory is referenced by other programs?
After a folder is renamed, shortcuts, scripts, synchronization tasks, or office document links that depend on the original path may need to be updated. Therefore, do not directly process system directories or project directories that are currently in use. For shared materials, confirm with users in advance.
Is a backup necessary?
A backup is recommended. Especially when using the boundary deletion rule for the first time, copy a small number of samples to a test directory first. Confirm that the processed names, file counts, and access status are all normal before executing it on the complete set of materials. The premise for batch processing to save time is that the rules have been verified.
7. Summary
When folder names are too long and invalid characters are located between two fixed markers, using boundary deletion is more efficient than renaming them one by one. Through HeSoft Doc Batch Tool , enter the "Folder Name" category, select "Delete text in folder names", add the target directories, set "All content between two texts", and then enter START and _END. This allows you to uniformly clear middle characters of different lengths and contents.
The value of batch processing in office software is not only to reduce the number of clicks, but more importantly, to make the same naming rule stably apply to all records. It is recommended to first use 3 to 5 test folders to verify the boundaries and switches, then check the save location and start formal processing. After completion, spot-check the first, middle, and last records to complete large-scale folder name cleanup more reliably.
Keyword:Batch clear folder names , delete middle characters in folder names , folder names too long , batch rename folders