How to batch delete leading text from multiple folders? A guide to cleaning fixed-length prefixes


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

Facing a large number of folders with legacy department codes, project abbreviations, or system prefixes, renaming them one by one is both slow and error-prone. This article explains how to use HeSoft Doc Batch Tool to clean fixed-length prefixes from folder names: first enter "Delete text in folder names", add the directories to be processed in one place, then select "The leftmost characters" and enter the number of characters, and finally follow the wizard to set the save location and start processing. The tutorial uses deleting a 3-character prefix and keeping an 8-character date as an example, and also adds practical notes on duplicate-name checking, directory path changes, and batch processing.

After office materials have been transferred multiple times, folder names often retain prefixes left over from old systems or old departments. For example, a project team initially used three-letter codes such as ABC, DEF, and GHI to distinguish data sources, but at the archiving stage only the date after the codes needed to be kept; or an export program added fixed markers to every directory, and after migration was completed those markers no longer had any practical meaning. In such cases, although the names can still be used, they no longer conform to the new archiving standards, and they also affect browsing and retrieval efficiency.

Selecting folders one by one, pressing F2, and deleting the leading text may look simple, but when faced with a large number of directories it becomes a typical repetitive office task. This article uses "deleting the leftmost 3 characters from multiple folder names" as an example to explain how to use HeSoft Doc Batch Tool to perform batch renaming. By setting unified rules, you can make every directory follow the same standard, reducing the problems of repeated input, missed changes, and accidentally deleting too many characters.

Applicable scenario: batch cleanup of fixed-length folder prefixes

Before deciding to use "the leftmost several characters", you should first understand what kind of naming problem it solves. This method is suitable for directories where the prefix content may differ, but the position and number of characters are consistent.

Cleaning up old department codes

For example, in CWX202401, RSB202402, and ZHB202403, the first three characters represent the old department. After organizational adjustment, department information no longer needs to be displayed, so you can delete the leftmost 3 characters from the names and keep the year-month or business number that follows.

Removing project abbreviations

During project implementation, folders are named in forms such as ABC Order 001 and DEF Order 002; after delivery to the unified archive repository, only the order number is kept. As long as the project abbreviations are all the same length, they can be processed as a fixed quantity.

Standardizing directories exported from systems

Some systems add fixed-length identifiers before the directory name when downloading. Manually renaming them after batch export is very labor-intensive, and the folder name batch processing feature in office software can be used to clean them up centrally.

Unifying date archive directories

When names are in the form "code + YYYYMMDD", removing the code gives you an 8-digit date directory. Once the date structure is unified, it is easier to sort, filter, search, and later transfer the directories.

If the prefixes to be deleted have different lengths, such as some directories starting with 2 characters and others with 3 characters, they should not be placed in the same fixed-quantity task. Instead, group them by prefix length first and process them separately, reducing the risk of errors from the start.

Preview of results: comparison before and after prefix deletion

Before processing: different letter codes occupy the left side of the names

The sample directories include ABC20240101, BCD20241010, DEF20240202, GHI20240303, JKL20240404, MNO20240505, PQR20240606, STU20240707, VWX20240808, and YZA20240909.

image-Batch delete leading text from multiple folders,batch clean folder prefixes,delete fixed-length folder prefixes,batch process office files

The letter content of these names is not exactly the same, so this task is not about deleting the same keyword. Their real shared characteristics are two: the letters are all at the far left, and they all occupy 3 characters. From this, you can determine that the most suitable approach is "delete 3 characters from the far left".

After processing: only the date numbers to be archived remain

After execution, the codes such as ABC, BCD, and DEF on the left side of the original names are no longer retained, and the folders are uniformly displayed as 20240101, 20240202, 20240303, and so on.

image-Batch delete leading text from multiple folders,batch clean folder prefixes,delete fixed-length folder prefixes,batch process office files

By comparison, you can see that the directories themselves still exist; what has changed is the name. The retained 8-digit numbers have not been recombined, but have simply lost the preceding 3 letters. The new names are more compact, and users can also directly determine the date from the directory name. Because File Explorer re-sorts by the new names, the display order after processing may differ from the original alphabetical order, which is a normal result of the name change.

Operating steps: batch delete leading text from names using office software

Step 1: Find the folder name deletion tool

Open HeSoft Doc Batch Tool . From the left side of the software interface, enter the "Folder Name" category, then in the function area select "Delete text from folder names".

image-Batch delete leading text from multiple folders,batch clean folder prefixes,delete fixed-length folder prefixes,batch process office files

The software interface also shows tools such as find and replace, insert text, add prefix and suffix, and case conversion. Different tools correspond to different goals: adding prefix and suffix is used to add characters, find and replace is used to change old text into new text, while the current task is to remove an existing prefix, so the delete text function should be selected.

After entering, you can see a stage-by-stage processing flow. First select records, then set processing options, then set the save location, and finally start processing. The wizard-style steps are suitable for batch tasks in office scenarios, allowing users to check the objects and parameters before actually executing.

Step 2: Add folders and check the task records

In the first stage, click "Add Folder" to add the directories to be cleaned of prefixes into the list. In the example page, there are 10 records in total.

image-Batch delete leading text from multiple folders,batch clean folder prefixes,delete fixed-length folder prefixes,batch process office files

The purpose of adding directories is not only to tell the software which folders to process, but also to perform a centralized check before formal execution. In the table, you can see the sequence number, name, path, creation time, modification time, and operation area. It is recommended to check in the following order:

  1. First look at the names: Confirm that each record has 3 characters to be deleted on the left side.
  2. Then look at the paths: Confirm that no test directories, backup directories, or other folders with the same names were mistakenly added.
  3. Check the record count: Compare the total shown on the page with the number of directories prepared for processing.
  4. Exclude abnormal items: If a directory does not conform to the rule, use the delete icon on that row to remove it from the task.
  5. Re-add if necessary: If the entire batch of directories was selected incorrectly, you can use "Clear" and then select again.

The 10 names in this example all conform to the structure "3 letters + 8 digits", so the same parameter can be used. After confirming, click "Next" at the bottom.

Step 3: Set the number of characters to delete from the far left

Enter the second stage, "Set processing options". The page lists various operation types, including deleting all digits, all Chinese characters, all English letters, all whitespace, all content, the rightmost several characters, all content between two text strings, a position range, and the leftmost several characters.

For this task, select "the leftmost several characters", and then enter 3 in the required "Quantity" input box.

image-Batch delete leading text from multiple folders,batch clean folder prefixes,delete fixed-length folder prefixes,batch process office files

This setting can be broken down into two conditions: "leftmost" determines the starting point of the deletion, and "3" determines the deletion length. The software will repeatedly apply the same rule to every folder in the task list, without the need to enter prefixes such as ABC, BCD, and DEF separately.

Before configuring, you can mentally simulate the result once: taking the leftmost 3 characters from ABC20240101 gives ABC, and after deletion it should become 20240101; taking the leftmost 3 characters from MNO20240505 gives MNO, and after deletion it should become 20240505. If the simulated result matches the goal, you can click "Next".

Step 4: Set the save location according to the wizard

After the processing options are complete, the flow enters "Set save location". When configuring, you should choose an appropriate location according to the purpose of the current task, and note that after the folder name changes, the corresponding path will also change. For ordinary archive directories, this is usually the expected result; however, if the original path has already been written into shortcuts, program configurations, Excel links, Word references, or other business records, the impact should be evaluated first.

To improve safety, you can first copy a small number of folders as test samples and execute exactly the same rules in the test location. After confirming that the doc, docx, xls, xlsx, ppt, pptx, PDF, images, and other materials in the folders can all be accessed normally, process the official directories. The document formats listed here are only to illustrate the types of office materials that may be contained in the folders, and do not mean that this feature will modify the contents of those files.

Step 5: Start processing and verify the results

After completing the save location settings, enter "Start Processing" and execute the batch task according to the on-screen prompts. After processing is complete, a simple acceptance check should be performed instead of relying only on the completion prompt.

  • Confirm whether the original 10 records correspond to 10 processing results.
  • Check whether all letters on the left side of the names have disappeared.
  • Confirm whether the 8-digit date numbers are complete, without missing the first or last digit.
  • Open several folders to confirm that the internal materials can still be viewed normally.
  • If the directories are used for sharing or synchronization, confirm that the relevant users can find the new paths.

The value of batch processing is not only speed, but more importantly rule consistency. As long as the targets are selected correctly and the deletion quantity is accurate, all directories will have the same renaming standard applied.

Frequently asked questions and considerations

1. What is the difference between fixed deletion of 3 characters and deleting all letters

Fixed deletion of 3 characters operates by position and length; deleting all letters operates by character type. If there are letters later in the name that need to be retained, such as ABC2024Q1, deleting all letters may also remove the Q, while deleting 3 characters from the left will only remove ABC. Therefore, you should choose the rule that best matches your goal.

2. If there are spaces before the name, how are the 3 characters counted

If there are spaces or other non-ignorable symbols at the far left of the name, they may occupy the leftmost positions, causing the actual deletion result to differ from what you expect. Before execution, observe the names carefully, and if necessary first handle the whitespace, or group abnormal directories separately for testing.

3. What should I do if duplicate names appear after deletion

Batch cleanup of prefixes may turn originally different directories into the same name. For example, after removing the first three characters, both ABC20240101 and DEF20240101 become 20240101. Before starting processing, compare whether the part to be retained in each name is unique. If duplicates exist, you should replan the naming, store them separately, or retain information that can distinguish the directories.

4. Can directories with different prefix lengths be processed together

It is not recommended. For example, AB20240101 and ABC20240202 require deletion quantities of 2 and 3 respectively. If you uniformly fill in 3, the first digit of the date in the first directory will be deleted by mistake. The correct approach is to first divide the 2-character prefixes and 3-character prefixes into two groups, then create tasks separately.

5. Will Word, Excel, or PDF files in the folders be deleted

The example feature processes text in folder names, not documents in the directories. However, renaming a folder changes the access path. For Word links, Excel external references, program configurations, or automation tasks that rely on fixed paths, you should check them in advance and update the relevant references after renaming.

6. Why is it recommended to back up before batch processing

Batch processing quickly applies the same rule to all records. This is an efficiency advantage, but it also means that incorrect parameters will affect the entire batch of directories. Backups and small-scale testing can help identify problems such as character count errors, duplicate names, and path references. This step should especially not be skipped for important materials.

7. How to determine whether the task truly succeeded after processing

Check at least three aspects: whether the quantity is consistent, whether the names conform to the rule, and whether the internal content is accessible. If they are date directories, you can also check whether the date length is uniformly 8 digits and confirm that the year, month, and day have not changed due to deleting too many or too few characters.

Summary

When multiple folder names have prefixes with different content but the same length, replacing them one by one by keyword is not the simplest method. As long as these prefixes are all located at the far left of the names and have the same number of characters, you can use the "Delete text from folder names" feature in HeSoft Doc Batch Tool , select "the leftmost several characters", enter the corresponding quantity, and execute the batch operation.

The example in this article uniformly processes directories such as ABC20240101 and DEF20240202 into 20240101 and 20240202, with the core parameter being deletion of the leftmost 3 characters. In actual use, do not directly copy the example quantity. Instead, first analyze your own naming structure, check for duplicate names and path references, make backups, and perform small-scale testing. After confirming that everything is correct, process the complete set of directories. This can significantly reduce the repetitive labor of manual renaming and keep project materials, date archives, and office document directories consistent, clear, and easy to search.


Keyword:Batch delete leading text from multiple folders , batch clean folder prefixes , delete fixed-length folder prefixes , batch process office files
Creation Time:2026-10-13 06:50:10
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.