How can I batch remove the middle field from folder names containing a fixed delimiter while preserving the prefix and suffix content?


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-13 07:08:56
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

The project directory often uses fixed delimiters to enclose version numbers, batch numbers, internal notes, or temporary tags. When archiving, if these fields are deleted one by one, the workload is large and the names before and after are easily damaged. This article introduces a method to batch clean folder names by left and right boundaries: use START and _END to locate the deletion range, retain the delimiter markers and the valid information before and after, and combine the operation interface to explain the complete process of adding directories, setting rules, checking switches, and verifying results.

Many teams combine business names, internal fields, and processing statuses into the same folder name when creating working directories. For example, "Client_START_2024Draft_END_Archive" contains both a client or project identifier and a draft year and archive status. This naming approach is convenient during the materials circulation stage, but when it comes to formal archiving, external distribution, or unified delivery, internal fields located between fixed delimiters often need to be removed.

If the content in the middle of each folder is different, ordinary word replacement is not practical: tempFiles, debugInfo, 2024Draft, batch001, alpha, and similar text cannot all be replaced by creating individual rules. A more appropriate method is to treat START as the left boundary and _END as the right boundary, and batch delete all content between the two texts. This article will explain how to complete this task using the operation interface of HeSoft Doc Batch Tool . This product is positioned as batch office file processing software, suitable for centrally processing large numbers of files or folders and reducing the time consumed by repeated clicking, manual input, and item-by-item checking.

1. When is deletion based on two text boundaries suitable

This processing method does not require the text to be deleted to be the same, but it does require folder names to have a recognizable structure. You can first observe the names to determine whether stable start markers and end markers are present.

For example, a batch of directories follows this rule:

BusinessName_START_FieldToDelete_END_StatusToKeep

Here, the "field to delete" may be letters, numbers, Chinese characters, or mixed text of any length. As long as START and _END exist at the left and right ends respectively, the range can be located by boundaries without worrying about what is actually written in the middle.

Common application scenarios include:

  • Removing internal code names from the development, testing, or draft stages during project archiving.
  • Clearing internal-only remark fields before sending customer materials to external parties.
  • Removing batch numbers, operator abbreviations, and temporary serial information when organizing finance or administrative directories.
  • Deleting process labels such as oldVersion and rawSet after design materials are finalized.
  • Clearing intermediate fields appended to folder names by source systems after data migration is completed.
  • Standardizing the naming format of multiple historical directories to make the positions of retained information clearer.

If names do not have stable boundaries, or if different folders use completely different delimiter rules, they should first be classified and then processed in batches with separate rules. Placing directories with very different structures into the same task may increase the risk of incorrect processing.

2. Before and after comparison: intermediate fields are deleted, while the preceding and following parts are retained

1. Before processing: intermediate field content differs

The pre-processing screenshot below shows 10 folders. They all contain START and _END, but the content between the two boundaries is different in each case. The red lines mark the text areas to be deleted.

image-Batch folder name cleanup,batch delete middle characters,rename with fixed delimiter,batch folder renaming tool

From the naming structure, this batch of directories has three characteristics:

  1. Text before START such as Backup, Build, Client, and Data needs to be retained.
  2. Content between START and _END such as tempFiles, debugInfo, and 2024Draft needs to be deleted.
  3. Statuses after _END such as Final, Release, Archive, and Clean still have business meaning and also need to be retained.

Because the length of the intermediate field is not fixed, deleting by character position, for example uniformly deleting the 10th through 20th characters, may cut off boundaries or suffixes. Using two texts as range boundaries can more accurately accommodate names of different lengths.

2. After processing: a unified and concise directory structure is formed

After batch processing is completed, the intermediate fields have been removed. START and END are still present, and the business information before and after the folder names has not been deleted by the target rule.

image-Batch folder name cleanup,batch delete middle characters,rename with fixed delimiter,batch folder renaming tool

For example:

  • Design_START_oldVersion_END_Approved becomes Design_START_END_Approved.
  • Notes_START_privateText_END_Public becomes Notes_START_END_Public.
  • Photo_START_rawSet_END_Edited becomes Photo_START_END_Edited.
  • Task_START_removeThis_END_Done becomes Task_START_END_Done.

The reason this is displayed as START_END is that the right boundary is set to "_END", so the underscore before the intermediate field is not separately treated as a retained character, while START itself and _END in the right boundary are retained. When setting boundaries, underscores, spaces, or hyphens should be treated as part of the naming rule rather than looking only at readable words.

3. Complete operation process

Step 1: Select the delete text function in the folder name tool

After starting HeSoft Doc Batch Tool , enter "Folder Name" from the left navigation. The main area will display multiple function entries related to batch folder renaming, including find and replace, insert text, add prefix and suffix, case conversion, and delete text.

image-Batch folder name cleanup,batch delete middle characters,rename with fixed delimiter,batch folder renaming tool

In this example, click "Delete text from folder names". This entry directly corresponds to the goal of this article: batch remove unwanted characters from multiple folder names according to specified conditions. After selection, you will enter a step-by-step task page, and the top of the page shows stages such as select records, set processing options, set save location, and start processing.

If the actual requirement is only to replace one fixed word with another, find and replace should be considered; however, in this example the intermediate field of each folder is different, so deleting based on two text boundaries is more appropriate.

Step 2: Build the list of folders to be processed

After entering the task, you are first at the "Select records to process" stage. Click "Add Folder" in the upper right corner to add the target directories to the list. The example list shows 10 folders and information such as their paths, creation times, and modification times.

image-Batch folder name cleanup,batch delete middle characters,rename with fixed delimiter,batch folder renaming tool

After adding, check the "Name" and "Path" columns row by row. The name is used to confirm whether START and _END exist, while the path is used to avoid confusing test directories with formal directories. If a record is not part of this batch, you can click the delete icon in its action column to remove it from the current task; if you need to select again, you can also use the "Clear" option provided in the interface to reorganize the list.

The example page shows "Record count: 10" at the bottom. In batch tasks, the record count is an important review basis. If 10 directories are expected but the page shows only 9 or more than 10, you should first go back to File Explorer to check for missing items, duplicates, or mistakenly selected items. After confirming the list is correct, click "Next".

Step 3: Use left and right texts to define the deletion range

On the "Set processing options" page, select "All content between two texts". This option allows the software to determine the range using two known texts, rather than deleting by content type or fixed position.

image-Batch folder name cleanup,batch delete middle characters,rename with fixed delimiter,batch folder renaming tool

Fill in according to the example names:

  • Enter START in "Left text".
  • Enter _END in "Right text".

Both fields have required markers, indicating that both left and right boundaries must be provided. After filling them in, you can verify the rule mentally with a real name: for "Data_START_sampleChunk_END_Clean", the left boundary is START and the right boundary is _END, and "_sampleChunk" between the two belongs to the area to be deleted, producing "Data_START_END_Clean" after processing.

Do not ignore symbols during verification. The right text is set to "_END" rather than "END" so that the matching condition is consistent with the actual names in the example. If the directories use "-END", " END", or other forms instead, you should enter it according to the actual names rather than copying the example.

Step 4: Set whether boundaries are included in the deletion range

"Include left text" and "Include right text" determine whether the boundaries themselves are deleted. In the example screenshot, both switches are off, so START and _END are not deletion targets, and only the content between them will be cleared.

Three common requirements can be distinguished:

  • Delete only the middle content: turn off both include switches, consistent with the example in this article.
  • Delete the middle content and the left boundary: enable the setting for including the left text according to the interface's meaning, but testing must be performed before execution.
  • Delete the middle content and the right boundary: enable the setting for including the right text according to the interface's meaning, and likewise inspect sample results first.

If you want the final names to retain neither START nor END at all, you need to carefully evaluate how the two boundaries and nearby delimiters are combined. To avoid consecutive underscores, extra spaces, or adjacent text sticking together, it is recommended to process a few copies first, confirm the results, and then expand the scope.

Step 5: Continue the subsequent process and execute processing

After confirming the processing options, click "Next" and continue according to the task stages shown in the interface. The process at the top of the page indicates that the following stages also include setting the save location and starting processing. When entering each stage, follow the actual prompts in the interface and verify the task targets and settings before executing.

Before starting batch renaming, it is recommended to make three preparations: close applications that are browsing these folders; pause synchronization, backup, or upload tasks that may occupy the directories; and save a list of the original folder names. For important projects, you can also first copy a small number of directories to a test location and run a trial with the same rules.

Step 6: Check by structure rather than looking at only one result

After processing is complete, view the target directories and compare the results with the name structure before processing. It is recommended to spot-check at least the following types:

  • Names whose intermediate field is a common English word, such as tempFiles.
  • Names whose intermediate field contains numbers, such as 2024Draft and batch001.
  • Names with a longer intermediate field, such as sampleChunk and removeThis.
  • Records with longer prefixes and suffixes, to confirm that both ends have not been truncated.

If all samples appear as "original prefix_START_END_original suffix", the current boundaries and include switches are basically consistent with the goal of this task. If the results contain extra symbols, review whether the left and right texts already include underscores or spaces, rather than continuing to batch modify directly on the incorrect results.

4. Common issues in operation

1. Does this delete files or the contents inside folders?

No. This article demonstrates deleting a segment of text from folder names, with the goal of modifying the directory name structure, not deleting the folders themselves, nor clearing doc, docx, xls, xlsx, pptx, PDF, images, or other office files inside the directories. When adding tasks, you should still carefully check the function entry to ensure that you are entering the delete text function under "Folder Name".

2. Must the middle content of all folders be the same?

No. The value of this method is precisely that the intermediate fields can differ. As long as the left and right boundaries are consistent, the software can locate the range based on START and _END. If some directories use other boundaries, they should be grouped and processed separately.

3. Why do some names not match after entering START?

This may involve differences in case, spaces, or symbols. For example, START, Start, and start are not exactly the same text in a name; _END, END, and " END" also have different delimiter forms. Compare the original names character by character, and if necessary copy the boundary text from the names.

4. Why is deletion by fixed position not recommended?

In the example, neither the business prefixes nor the intermediate field lengths are consistent. A fixed position may be correct for one name but delete START, END, or the suffix status in another. Locating by two fixed texts is more suitable for folder names whose lengths vary but whose structure is consistent.

5. What path issues need attention after renaming?

Folder names are part of paths. If Word document links, Excel external references, scripts, shortcuts, synchronization software, or business systems record the original paths, those references may need to be updated after renaming. Therefore, before formally processing shared directories, project directories, and archive directories, confirm whether path dependencies exist and choose an appropriate time to execute.

6. What should be done if START or END appears multiple times in a folder name?

Repeated boundaries may make the deletion range ambiguous. When facing such names, do not directly execute them in large batches together with ordinary records. You can first filter out directories with repeated boundaries, copy a small number of samples for testing, confirm that the software's actual processing results meet expectations, and then decide on the follow-up plan.

7. How can the risk of batch renaming be reduced?

Test first, verify, and then execute in batches. Specifically, back up the original names first, select a small number of copies to add to the list, run them with the same START and _END rules, and confirm that the switch states and symbol handling are correct. After executing on the formal directories, spot-check multiple records from different positions rather than checking only the first item.

5. Summary

When folder names use the structure "front information + left boundary + temporary field + right boundary + back information", deleting based on two text boundaries is a more efficient method than renaming item by item. The example in this article uses HeSoft Doc Batch Tool to set START as the left text and _END as the right text, and turns off both "include" switches, thereby batch clearing the intermediate fields while retaining the boundaries and the content before and after the names.

This type of batch office processing is especially suitable for project archiving, customer material organization, version directory cleanup, and historical data standardization. It can compress repeated selection, positioning, deletion, and confirmation operations into one unified rule. It is recommended to first select a few folder copies with the same naming structure and complete a test according to the steps in this article; after confirming that the processed names meet the requirements, add all target directories and complete the batch cleanup in a more reliable manner.


Keyword:Batch folder name cleanup , batch delete middle characters , rename with fixed delimiter , batch folder renaming tool
Creation Time:2026-10-13 07:08:40
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.