How to batch delete folder prefixes with inconsistent lengths? Tutorial on extracting the right-side name by specified keywords


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-10-12 22:31:41
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 folder prefixes vary in length, deleting by a fixed number of characters often fails to yield consistent results. A more suitable approach is to use a common keyword in the names as a boundary and batch-remove the characters to its left. This article demonstrates the complete workflow using HeSoft Doc Batch Tool : add multiple folders, select "everything to the left of a specific text", enter START, and disable "include this text" to retain the keyword. After processing, prefixes from different sources are removed uniformly, making this suitable for standardizing project directories, customer files, and archived folders containing Word, docx, Excel, PDF, and image files.

In daily office data management, folder names often accumulate prefixes as staff change, systems export files, and projects are archived. For example, the same batch of materials may be named Backup_START_tempFiles_END_Final, Invoice_START_batch001_END_Paid, and Project_START_alpha_END_Report. Although these names all contain the identifier START, the parts to the left of START—Backup_, Invoice_, and Project_—differ in length, so they cannot be cleaned uniformly by simply deleting a fixed number of characters from the beginning.

When you encounter dozens or even hundreds of similar folders, opening each rename box one by one, selecting the prefix, and deleting it is not only repetitive but also prone to accidentally deleting underscores, missing a directory, or damaging the part of the name that needs to be preserved. A more reliable approach is to treat START as a text boundary: no matter how many characters appear to its left, delete all content on the left and keep only START and the text to its right.

The following uses the office batch processing software " HeSoft Doc Batch Tool " as an example to explain how to batch truncate folder names by a specified keyword. The entire workflow includes selecting a feature, importing folders, setting the deletion rule, confirming the save settings, and starting the process. It applies to project materials, client archives, and filing directories for Word, doc, docx, Excel, PDF, image, and video files.

Applicable scenario: inconsistent prefixes but a common keyword in the names

Deleting the content to the left of a specified text is suitable for folders that have a clear naming boundary. Unlike deleting a fixed prefix, this method does not care what exactly is written on the left, nor does it require the same number of characters on the left. It only requires that the same locating text exists in every name to be processed.

The following situations are usually suitable for this method:

  • Multiple departments added their department names to project folders, but a uniform identifier appears before the project number.
  • System-exported directories contain user, device, or source prefixes and need to be kept starting from a business keyword.
  • Historical folders contain inconsistent beginnings such as Backup, Temp, Old, and Client, and need to be removed uniformly.
  • Customer data directories have owner names at the beginning, while a fixed contract, order, or project identifier appears in the middle.
  • Outer archive folders for Word, docx, doc, Excel, PDF, PPT, image, and other materials need to have their names standardized in batches.

If the content to be deleted is exactly the same, find-and-replace may also be considered; however, in this example the left prefixes are Backup_, Build_, Client_, Data_, and so on, which differ in both content and length. In this case, using START to locate the boundary and then deleting everything to its left is more direct than creating multiple replacement rules.

Result preview: from messy source prefixes to unified naming

Folder list before processing

Before processing, the 10 folder names have a similar structure, but the source prefix at the far left of each name is different. The red-marked areas show the parts that need to be cleaned, and the arrows point to the common START. In other words, START is the boundary for this batch rename.

image-Batch delete folder prefixes,truncate folder names by keyword,batch retain the content on the right side of folder names,batch rename folders,delete characters to the left of specified text

These names can be split into three parts: the unnecessary left prefix, the locating text START, and the right-side name to be retained. Taking Design_START_oldVersion_END_Approved as an example, Design_ is the prefix to be deleted, START is the boundary text, and _oldVersion_END_Approved is the content on the right. The target name should be START_oldVersion_END_Approved.

Because the left prefix length differs for each record, deleting a fixed number of characters uniformly would leave remaining letters in some folders and delete too much in others. Therefore, this tutorial does not use deletion by character count, but rather deletion by the position of a specified text.

Unified result after processing

After the batch process is complete, the original left prefixes of each folder have disappeared, and all names now start from START. The content after START, such as 2024Draft, alpha, batch001, debugInfo, oldVersion, privateText, rawSet, removeThis, sampleChunk, and tempFiles, is still retained.

image-Batch delete folder prefixes,truncate folder names by keyword,batch retain the content on the right side of folder names,batch rename folders,delete characters to the left of specified text

Such results are more suitable for continued sorting, searching, and archiving. For example, users can establish follow-up management rules based on the project status, batch number, or material type after START. It should be noted that the order of the lists before and after processing in the screenshots is not identical, which is usually related to how File Explorer sorts by name; it is normal for the order to change after names have changed.

Steps: batch delete folder name prefixes by START

Step 1: Select the text deletion feature in the folder name tool

Start HeSoft Doc Batch Tool . This product is positioned for batch processing of office files and can be used to reduce repetitive operations in file and folder organization. This task targets folder names, so click "Folder Name" in the left navigation bar.

After entering the corresponding tool category, find and click "Delete text in folder names." The description on the interface card shows that this feature is used to batch delete text in folder names, which matches the need to clean prefixes by boundary.

image-Batch delete folder prefixes,truncate folder names by keyword,batch retain the content on the right side of folder names,batch rename folders,delete characters to the left of specified text

Choosing the correct feature is important. "Add prefix and suffix to folder names" is used to add content, and "Insert text into folder names" is used to insert characters, while the goal this time is to remove existing content, so you should enter the text deletion feature.

Step 2: Batch add the directories that need to be renamed

After entering the task page, the first stage is "Select the records to process." Click "Add Folders" in the upper right corner to add the directories to be processed to the list. After adding them, the software will display the name and path of each record, as well as information such as creation time and modification time for verification.

image-Batch delete folder prefixes,truncate folder names by keyword,batch retain the content on the right side of folder names,batch rename folders,delete characters to the left of specified text

In the screenshot, 10 folders have been added to the list, and the summary area shows 10 records. Do not rush to the next step at this point. It is recommended to check each name one by one to confirm that every folder contains START, and ensure that they are all objects whose prefixes need to be removed this time.

If a folder was added by mistake, you can click the delete icon in the operation column of that row to remove it from the current task list. If the entire batch of records is incorrect, you can use "Clear" and then add them again. Removing an item from the task list here is used to adjust the processing scope and should not be confused with deleting the actual folder on disk.

For important working directories, you should also check the "Path" column. Folders with the same name may exist on different drives or in different parent directories, so looking only at the name may lead to misjudgment, while the full path can help confirm the processing location. After checking everything, click "Next" at the bottom of the page.

Step 3: Set the deletion boundary and locating text

After entering "Set processing options," select "All content to the left of a specified text" in the "Operation type" area. This option means: first find the specified text in the folder name, then clear all characters to the left of that text.

Next, enter START in the required "Text" input box. Do not add extra quotation marks or spaces when entering it. Enter the exact capitalization and character form based on the actual folder names.

image-Batch delete folder prefixes,truncate folder names by keyword,batch retain the content on the right side of folder names,batch rename folders,delete characters to the left of specified text

As shown in the screenshot, the "Include this text" switch is off. This setting determines whether the locating text belongs to the deletion range. When it is off, the software deletes only the content to the left of START, while START itself is retained. Therefore:

  • Build_START_debugInfo_END_Release will become START_debugInfo_END_Release.
  • Notes_START_privateText_END_Public will become START_privateText_END_Public.
  • Task_START_removeThis_END_Done will become START_removeThis_END_Done.

If "Include this text" is turned on, the processing range will include START as the boundary. Since the target result in this tutorial needs to start with START, the switch should remain off as shown in the screenshot. This detail directly affects the final names and must be confirmed before actual execution.

Step 4: Enter the save settings and execute the task

After the rule is configured, first mentally simulate the result with one or two folder names. For example, if Photo_START_rawSet_END_Edited is processed with the current rule, it should become START_rawSet_END_Edited. If the simulated result matches the requirement, click "Next."

According to the process indicator at the top of the page, the subsequent stages are "Set save location" and "Start processing." Complete the save-related settings according to the actual prompts in the software interface, and check this task before starting. Since the provided screenshot does not show the specific options on the save page, you should follow the current software version's interface and not skip confirmation simply out of habit.

After starting the process, do not move these folders in File Explorer for the time being, and do not modify them simultaneously with another batch renaming program. After processing is complete, open the target location and check whether the folder names all start with START, and confirm that the content on the right is intact.

Batch processing logic explained: how it differs from deleting fixed characters

"Delete a fixed number of characters" mechanically deletes the same number of characters from the far left of each name, and is suitable for cases where the prefix length is exactly the same. For example, if every name starts with a three-digit number followed by an underscore, deleting four characters may work. However, in this example, Backup_, Build_, Invoice_, and Project_ have different lengths, so a fixed character count cannot suit all of them at the same time.

"All content to the left of a specified text" uses a dynamic position. The software needs to locate START in each name and then treat the part before START as the area to be deleted. No matter whether START appears at the sixth, eighth, or tenth position, as long as the text can be found, it can be processed using the same logic.

Therefore, before choosing a rule, you can first observe the name structure:

  • If the left content is exactly the same, consider finding and replacing fixed text.
  • If the left length is the same but the content differs, consider processing by position according to the actual feature.
  • If the left content and length are both different, but a common keyword exists, the method in this tutorial is suitable.
  • If the names do not even have a common keyword, they should be classified first rather than forcibly applying the same rule.

Common questions and precautions

1. Why must you choose text that exists in all names

The specified text serves as the locating basis for the deletion operation. If only some names contain START, the boundary of other names may not be determined as expected. It is recommended to check the names in the list after adding folders, and split directories with different structures into multiple batches, using a stable locating text for each batch.

2. Should the underscore be included in the locating text

This depends on the target name. In this example, the desired result is START_tempFiles_END_Final, so enter START and keep the underscore to the right of START. If you want the result to start from tempFiles, you need to reassess which characters should be kept or deleted, and test with the "Include this text" setting. Do not execute directly on all directories without verification.

3. What if the locating text has different capitalization

The folders in the example uniformly use uppercase START, so the input is also uppercase START. If actual materials contain START, Start, and start at the same time, the naming structure is not completely consistent. To make the results more controllable, it is recommended to group them by capitalization and first confirm the matching effect with samples.

4. What if two STARTs appear in one name

When the locating text appears more than once, you need to confirm which occurrence should be used as the boundary. The screenshot does not show the rule for repeated text, so it should not be inferred directly. The safest method is to separate such special folders, test them on copies, and decide whether to include them in the batch task only after confirming the result.

5. Will batch renaming affect the documents inside the folders

This feature modifies folder names, and is not equivalent to editing the Word, doc, docx, Excel, PPT, PDF, image, or video content inside them. However, renaming folders changes the access path. If shortcuts, scripts, databases, or other office systems record the old paths, the related references may need to be updated after renaming.

6. Do I need to back up before processing

For important projects, shared materials, or directories with many path dependencies, it is recommended to back them up first, or at least copy a small number of samples for testing. Batch tools can improve efficiency, but once a rule is set incorrectly, errors may also be applied quickly to many records. Testing on a small batch first and then executing formally is a safer approach when processing office materials.

7. Why should you spot-check multiple records after processing

Checking only one folder cannot cover all naming differences. It is recommended to check at least the shortest name, the longest name, and records containing special characters, and confirm three aspects: whether the left prefix has been completely removed, whether START is retained, and whether the text on the right is intact. If any abnormality is found, stop further organization and recheck the rules.

How to improve the efficiency of subsequent folder organization

After completing this prefix cleanup, you can further establish a unified directory naming convention. For example, agree on fixed project identifiers, batch fields, status fields, and their order to prevent different people from arbitrarily adding temporary prefixes. Unified rules not only make future batch processing easier, but also benefit File Explorer searches, team collaboration, and data handover.

When you later need to delete right-side remarks, replace status keywords, unify English capitalization, or add prefixes and suffixes, split each modification into an independent task, process only one rule at a time, and check the results after each step. Compared with stacking multiple complex modifications at once, this staged approach makes problems easier to detect, and also makes rollback and verification easier.

Summary

When the prefix content and length of folder names are inconsistent, deleting by a fixed number of characters is unreliable. As long as a common keyword exists in these names, you can use the keyword as a boundary and batch delete all content to its left. The example in this article uses HeSoft Doc Batch Tool , navigating in sequence to "Folder Name" and "Delete text in folder names," adding the directories to be processed, selecting "All content to the left of a specified text," entering START, and turning off "Include this text," ultimately retaining START and the name on the right.

This batch folder renaming method is especially suitable for project directories, client archives, and various office document filing scenarios. It is recommended to pick a few folder copies, complete a test according to the tutorial, and after confirming that the output names are accurate, add the complete directory list and execute the batch. Replacing one-by-one renaming with unified rules can significantly reduce repetitive operations and human omissions, making large-scale file organization more efficient and controllable.


Keyword:Batch delete folder prefixes , truncate folder names by keyword , batch retain the content on the right side of folder names , batch rename folders , delete characters to the left of specified text
Creation Time:2026-10-12 22:31:18
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.