When file names are cluttered with temporary numbers, version descriptions, collection marks, or useless fields, renaming them one by one is not only time-consuming but also prone to missed or mistaken deletions. This article uses HeSoft Doc Batch Tool as an example to demonstrate how to use the "Delete text from file names" feature to batch delete all content between the texts START and _END in file names, suitable for cleaning up file names of various types such as txt, doc, docx, pdf, and xlsx.
In daily office work, filenames often contain some intermediate fields, such as temporary project numbers, identifiers generated by export systems, draft version notes, batch numbers, internal remarks, etc. A small number of files can be manually modified, but if there are dozens, hundreds, or even more files in a folder that need to have the content between two specified texts uniformly removed from their names, manual operation becomes very inefficient and prone to issues like omissions, incorrect deletion positions, or accidental changes to file extensions.
The problem addressed in this article is very specific: when filenames have structures like Archive_START_oldPart_END.txt or Doc_START_2024Draft_END.txt, you want to keep the filename prefix on the left, retain the two boundary texts START and _END, and delete the variable content between them, such as oldPart, 2024Draft, sample, alpha. The following will combine screenshots and use the batch file name processing capability in the office software HeSoft Doc Batch Tool to explain how to accomplish this type of batch renaming task.
Applicable Scenarios: Which Filenames Are Suitable for This Batch Cleanup
"Batch delete all content between two texts in file names" is suitable for processing filenames that have fixed boundaries but variable content in the middle. For example, the first part of the filename represents a business type, the middle part is a temporary field, and the latter part is a fixed ending marker or suffix. As long as you can determine the left boundary text and the right boundary text, you can batch delete the middle content according to rules.
Common scenarios include:
- Filenames exported from a system contain a batch number, like Report_START_batch001_END.pdf, where batch001 needs to be deleted.
- Word document, docx, or doc filenames include version descriptions, like Contract_START_draftV2_END.docx, requiring unified cleanup of the version notes in the middle.
- Excel spreadsheet xls, xlsx filenames contain temporary numbers, like Sheet_START_tempData_END.xlsx, requiring the fixed naming structure to be preserved.
- Text files txt, log files, image files, or compressed archives carry collection markers that need batch deletion of the specified interval content.
- There are a large number of files in the same folder with consistent naming rules, and you want to reduce repetitive renaming operations.
The key to this type of task lies not in the file extension, but in whether the filename itself has identifiable "left text" and "right text". The examples in the screenshots are txt files, but the same logic can be applied to cleaning up other common office filenames, such as Word, PDF, Excel, and PPT files, as long as the software imports the file records that need processing.
Effect Preview: Filename Changes Before and After Processing
First, look at the file list before processing. In the screenshot, multiple filenames contain START and _END, with the middle sections being oldPart, sample, 2024Draft, alpha, rawName, debugInfo, private, tempData, batch001, removeThis, etc. These middle texts vary in length and meaning, but they are all located between the same set of boundary texts.

The goal of this processing is not to delete START or _END, but to delete all content between them. In other words, Archive_START_oldPart_END.txt will become Archive_START_END.txt; Data_START_sample_END.txt will become Data_START_END.txt; Doc_START_2024Draft_END.txt will become Doc_START_END.txt.
The result after processing is shown in the following image. As can be seen, the middle field in each filename has been uniformly cleared, while START and _END are still retained, and the file extension .txt is unaffected.

This processing method is particularly suitable for standardizing filenames in batches: it preserves the original naming structure while removing unwanted variable fields. Compared to manual editing one by one, batch processing can significantly reduce repetitive labor and lower the probability of human input errors.
Operation Steps: Using HeSoft Doc Batch Tool to Batch Delete Middle Text
Step 1: Enter the "File Name" Category and Select the Delete Text Function
After opening HeSoft Doc Batch Tool , you can see multiple tool categories on the left, including File Name, Folder Name, File Organization, Word Tools, Excel Tools, PowerPoint Tools, PDF Tools, Text Tools, Image Tools, etc. Since this task deals with the filenames themselves, you need to enter the File Name category on the left.
In the list of file name related functions, select Delete Text in File Names. In the screenshot, this function is the 10th item, with the description "Batch delete text in file names". What needs to be deleted this time is all content between two specified texts in file names, which falls exactly within the application scope of this function.

The purpose of choosing this function is to enter the dedicated interface for setting batch filename deletion rules. Once inside, the software will guide the user through the steps of record selection, processing option setup, save location setting, and starting the process.
Step 2: Add or Import Files That Need Processing
After entering the "Delete Text in File Names" interface, you can see the operation flow at the top: the first step is "Select records to be processed". The upper right provides buttons like Add File, Import Files from Folder, Clear, and More. For a small, scattered number of files, you can use "Add File"; if all files are concentrated in one folder, using "Import Files from Folder" is usually more efficient.
In the screenshot, 10 records have already been imported, and the table lists the sequence number, name, path, extension, creation time, modification time, and operation. Through this list, users can double-check if the files are correct before processing. For example, you can confirm whether the filenames all contain START and _END, whether the extensions are the types you need to process, and whether the paths come from the target folder.

The expected outcome of this step is: all files that need batch renaming appear in the list, and the record count matches the actual number of files to process. The bottom of the screenshot shows "Record Count: 10", indicating that the subsequent rules will be executed on 10 files.
Step 3: Enter Processing Options and Select "All Content Between Two Texts"
After confirming the file list, click Next at the bottom to enter the second step, "Set Processing Options". In the operation type area, you can see multiple deletion rules, such as all digits, all whitespace, the rightmost few characters, all Chinese characters, all content, all content to the left of a certain text, position range, all English letters, the leftmost few characters, all content to the right of a certain text, etc.
The requirement this time is to delete the content between START and _END, so you should select All content between two texts. In the screenshot, this option is already checked.

The purpose of selecting this operation type is to tell the software not to delete by a fixed number of characters, nor by types like digits, letters, or whitespace, but to locate the deletion range based on two boundary texts. This method is particularly useful for filenames with inconsistent middle content lengths. For example, oldPart, sample, 2024Draft, debugInfo, batch001 all have different lengths; deleting by a fixed character count would be unreliable, whereas using left and right boundary positioning allows for unified processing.
Step 4: Fill in Left Text and Right Text
Under the "All content between two texts" rule, two key fields need to be filled: Left Text and Right Text. In the screenshot, the left text is filled with START, and the right text is filled with _END.
Note here that the text must match the actual characters in the filename. For example, the filenames in the screenshot are like Archive_START_oldPart_END.txt, where the left boundary is START and the right boundary is _END. The right boundary includes an underscore, so you should also write it as _END, not END. After processing, the software will identify the content after START and before _END, and delete that part.
The screenshot also shows two switches: "Include left text" and "Include right text". The current goal is to retain START and _END, only deleting the content between them, so keep these two switches turned off. The final result will then be START_END, instead of deleting START or _END together.
Step 5: Continue to Set Save Location and Start Processing
After completing the processing option settings, click Next at the bottom of the interface. According to the process bar, the subsequent steps include "Set Save Location" and "Start Processing". In actual office work, it is recommended to confirm the save method before starting batch processing, especially for important files or a large number of files; it's best to keep a backup of the original files or output to a location convenient for checking.
Before entering the start of processing, check the following again: Is the file list correct? Is the left text START? Is the right text _END? Do you need to retain the left and right boundary texts? If everything is confirmed, proceed to start processing. After completion, go to the corresponding location to view the filenames, and you will see that the middle content has been batch deleted.
Common Questions and Precautions
1. Should the left text and right text include underscores?
This should be decided based on the actual filenames. In the screenshot, the right boundary is written as _END, with a leading underscore. If you only fill in END, the deletion range might not be exactly as expected. When processing filenames, the more precise the boundary text, the more stable the batch results will be.
2. What if a filename does not have START or _END?
If some filenames do not contain the specified left text or right text, the software may not be able to locate the corresponding content according to the rule. Therefore, after importing files, it is recommended to check the naming rules through the list first, and if necessary, only import files that match the rules, or process files with different naming structures in batches.
3. Will the extension be affected?
Looking at the screenshot results, the rule this time processes the middle text in the filename, and the extension .txt remains unchanged before and after processing. To avoid misoperation, do not include the extension as part of the deletion range when setting the right text, unless your actual need is to process the content before the extension.
4. Can it handle inconsistent middle content lengths?
Yes. The advantage of this type of rule is that it does not rely on a fixed length but on the left and right boundary texts. As long as the middle content is between START and _END, whether it is oldPart, 2024Draft, or batch001, it can all be deleted by the same rule.
5. Is this method also applicable to Word, PDF, and Excel filenames?
If you are only modifying the filename, not the file content, you can usually process doc, docx, pdf, xls, xlsx, pptx, txt and other files following the same logic. The key is still whether there are clear left and right boundary texts in the filename.
Summary: Using Batch Processing to Reduce Repetitive Renaming Work
Batch deleting all content between two texts in file names is a very practical method for organizing filenames. It is suitable for processing files with unified rules but different middle fields, such as office files containing temporary numbers, batch numbers, version descriptions, or system export markers.
Through HeSoft Doc Batch Tool , you can first import the files that need processing, then select "Delete Text in File Names", and use the "All content between two texts" rule in the processing options. As long as you correctly fill in the left text and right text, you can batch obtain standardized filenames.
If you are facing a large number of files that need renaming, it is recommended to first select a small sample to verify the rules, and then batch import the full folder for processing. This approach can improve efficiency, reduce the risk of accidentally deleting filename information, and make file organization tasks more stable and controllable.