How to batch clear the middle part of filenames? Method to delete content between two keywords


Translation:EnglishFrançaisDeutschEspañol日本語한국어,Update Time:2026-06-24 06:41:33

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

In the process of exporting, archiving, or circulating many office files, temporary fields are often automatically added to file names, such as serial numbers, draft identifiers, or remarks between START and _END. This article uses HeSoft Doc Batch Tool to introduce how to use the "Delete text in file names" feature to locate and batch delete content between two keywords, helping users quickly organize file names such as txt, docx, pdf, and xlsx.

When organizing files, the most troublesome part is often not renaming a single file, but a batch of files all having the same formatting issue. For example, file names all contain START and _END, but the content between these two texts varies: some have sample, some have alpha, some have 2024Draft, and others have tempData. If you open the folder and press F2 to rename them one by one, it not only consumes time but may also lead to inconsistent file names due to inaccurate copying, deleting, and input positioning.

This article introduces a processing method more suitable for office scenarios: using HeSoft Doc Batch Tool , through the file name processing function, to batch delete the content between two keywords in file names. Its core idea is: use START as the left positioning text, and _END as the right positioning text, allowing the software to automatically find the middle area and delete it, thereby obtaining unified, clean file names in batch.

Applicable Scenarios: Why Delete Content Between Two Keywords in File Names

In scenarios such as enterprises, schools, finance, human resources, design, and project management, file names often come from different systems or are manually named by different personnel. For easier processing, file names may contain some temporary information, such as export batches, version statuses, internal numbers, review marks, source notes, etc. This information might be useful during file transfer but becomes redundant when archiving, uploading, delivering, or sharing.

If this redundant content has fixed boundaries, it can be quickly cleaned up using the "delete content between two keywords" method. For example:

  • Contract file: Contract_START_draft_END.docx, you want to keep Contract_START_END.docx.
  • Report file: Report_START_batch003_END.xlsx, you want to delete batch003.
  • Log file: Log_START_debugInfo_END.txt, you want to delete debugInfo.
  • Scanned document or PDF: Invoice_START_temp_END.pdf, you want to remove temp.
  • Image material: Image_START_rawName_END.png, you want to keep the fixed structure.

The advantage of this type of operation is that the rules are clear and can be executed in batch, without needing to care about how many characters are in the middle field, nor needing to set deletion content for each file individually. As long as the left and right texts are consistent, batch processing software can help users save a lot of repetitive work.

Effect Preview: Before and After Comparison for a More Intuitive View

Below is an example of file names before processing. You can see that each file adopts a similar structure of "Prefix_START_MiddleContent_END.txt". The positions marked in red are the middle fields that need to be deleted, such as oldPart, sample, 2024Draft, alpha, etc.

image-Batch clear middle field of file names,batch delete content between two keywords,batch modify file names,batch rename office files,delete text in specified interval of file names

The common point of this batch of files is: prefixes like Archive, Data, Doc, File, Image need to be retained, as do the fixed texts START and _END; what really needs to be deleted is the variable content after START and before _END. Since the middle field is different for each file, manual processing would require judging the deletion range one by one, whereas batch rules can complete this in one go.

After processing, all file names become a more unified structure. The temporary middle content has disappeared, for example, Archive_START_oldPart_END.txt becomes Archive_START_END.txt, and Sheet_START_batch001_END.txt becomes Sheet_START_END.txt.

image-Batch clear middle field of file names,batch delete content between two keywords,batch modify file names,batch rename office files,delete text in specified interval of file names

From the processing results, it's clear that the main structure of the file name is not damaged, and the extension remains normal. This is the most important effect in batch renaming office files: deleting redundant information while avoiding impact on file types and original classification information.

Operation Steps: Follow the Screenshots to Batch Delete Middle Fields in File Names

Step 1: Open the file name tool and find the function to delete file name text

After starting HeSoft Doc Batch Tool , first select File Name from the left navigation bar. This category includes various batch operations related to file names, such as finding and replacing keywords in file names, inserting text into file names, adding prefixes and suffixes, etc. This time, the goal is to delete a specified text area within the file name, so select Delete text from file names.

image-Batch clear middle field of file names,batch delete content between two keywords,batch modify file names,batch rename office files,delete text in specified interval of file names

The purpose of this step is to enter the specialized batch text deletion process. Unlike ordinary renaming, this is not about re-entering a new name for each file but letting the software automatically process multiple file names through a unified rule. For folders with a large number of files, this method is more suitable for batch organization.

Step 2: Import the file records to be renamed

After entering the function interface, the software first asks you to select the records to be processed. In the upper right corner of the interface, you can see two common entry points: Add Files and Import Files from Folder. If the number of files is small and they are distributed in different locations, you can use "Add Files"; if the files are all in the same directory, using "Import Files from Folder" is usually more convenient.

The table in the screenshot already lists 10 files, with names including Archive_START_oldPart_END.txt, Data_START_sample_END.txt, Doc_START_2024Draft_END.txt, etc. The table also shows the path, extension, creation time, and modification time, making it easy to check the file source and file type before performing the batch operation.

image-Batch clear middle field of file names,batch delete content between two keywords,batch modify file names,batch rename office files,delete text in specified interval of file names

At this step, it is recommended to focus on checking three points: first, whether the number of records equals the number of files to be processed; second, whether the file names all conform to the "START + MiddleContent + _END" structure; third, whether any files that should not be processed are mixed in. If a record does not need processing, you can remove it from the list via the operation column, or clear and re-import.

Step 3: Select the deletion rule as "Between two texts"

After confirming the file list is correct, click the Next button at the bottom to enter "Set Processing Options". This page provides multiple operation types, such as delete all numbers, all spaces, all Chinese characters, all English letters, several characters from the far left or far right, all content to the left or right of a certain text, etc.

Since the requirement this time is to delete the content between two keywords, you should select All content between two texts. This point is crucial: if "Several characters from the far left" or "Several characters from the far right" is chosen, the character count must be fixed; but in the example, oldPart, sample, 2024Draft, and batch001 have different lengths, so a fixed character count is not suitable.

image-Batch clear middle field of file names,batch delete content between two keywords,batch modify file names,batch rename office files,delete text in specified interval of file names

The advantage of choosing "Between two texts" is more precise positioning. The software first finds the left text, then the right text, and then deletes the part between them. As long as the boundary texts are consistent, the middle content's length and specific characters can vary.

Step 4: Fill in the left text START and the right text _END

In the processing options, fill in START for the left text, and _END for the right text. These two values must exactly match the characters appearing in the file names. For example, in Archive_START_oldPart_END.txt, START is the fixed text to the left of the middle content, and _END is the fixed text to the right of the middle content.

A common point of error here is the underscore. The right boundary in the example is not just END, but _END with an underscore. If the underscore is omitted, the rule might still match END, but the result after deletion might not be the format you want. Therefore, before batch processing, carefully confirm the boundary text character by character against the file names.

The page also shows two switches: "Include left text" and "Include right text". In the current screenshot, these two switches are off, which is suitable for this case: only delete the content between START and _END, not START and _END themselves. If your actual requirement is to delete the boundary texts together, adjust according to the interface options; but in this example, to get the result START_END, the boundary texts should not be included in the deletion.

Step 5: Set the save location and execute processing

After setting the deletion rules, click the bottom Next button. The progress bar shows that "Set Save Location" and "Start Processing" follow. Before formal execution, it is recommended to confirm the save location or processing method to avoid irreversible effects on important files. For first-time use or cases with many files, you can first test with a small number of sample files to confirm the results meet expectations before processing the entire folder.

When entering the start processing phase, the software will batch modify the file names according to the set rules. After processing, check the results in the folder, and you will see that the middle fields have been cleared, with file names changed to a unified format like Archive_START_END.txt, Data_START_END.txt, Doc_START_END.txt, etc.

Common Questions and Notes

1. Can middle fields containing numbers, English, or Chinese all be deleted?

This case uses two boundary texts for positioning. As long as the middle field is located between the left text and the right text, theoretically, there is no need to care whether it is numbers, English, Chinese, or mixed characters. Compared to "Delete all numbers" or "Delete all English letters", this method is more suitable for cleaning specified intervals.

2. What if a file name contains multiple STARTs or multiple _ENDs?

This situation requires caution. Multiple identical boundaries might lead to positioning results inconsistent with expectations. It is recommended to unify naming rules first, or process files with clearer structures in batches. Before batch renaming, you can view the file names in the list to confirm if duplicate boundaries exist.

3. Why retain START and _END after processing?

In the screenshot example, START and _END are fixed structures that need to be retained, and the variable content between them is what gets deleted. This way, the processed file name still has a unified marker, facilitating later sorting, searching, and archiving. If these markers are not needed in your business, you can adjust the rules according to actual needs, but this article demonstrates the approach of keeping the boundary text.

4. Can this be used for doc, docx, pdf, xlsx and other files?

Essentially, this is file name processing, not file content editing. As long as the imported file names conform to the rules, common office files can be processed in the same manner, such as Word's doc, docx, Excel's xls, xlsx, PDF, PPT, txt, etc. During processing, be careful not to accidentally delete necessary information before the extension.

5. Is a backup needed before batch processing?

A backup is recommended, especially when processing important project materials, financial files, contract documents, or folders with large quantities. Although batch tools can significantly improve efficiency, if a rule is set incorrectly, it might batch-produce file names that do not meet expectations. Backing up first or testing with a sample is a more prudent office habit.

Summary: Improve File Organization Efficiency with Rule-Based Batch Renaming

Deleting the content between two keywords in a file name may seem like a small requirement, but it is very common in actual office work. Scenarios such as system export files, project material archiving, batch file downloads, log organizing, and document delivery can all encounter the problem of redundant middle fields.

Through HeSoft Doc Batch Tool , the file name organization work that originally required modifying one by one can be transformed into a single rule setup: import files, select "Delete text from file names", check "All content between two texts", fill in the left text START and the right text _END, and then continue processing according to the steps. This not only saves time but also makes the file name format more unified.

If you are organizing a batch of files with fixed boundary texts, it is recommended to follow the steps in this article to process a small number of examples first, confirm the effect, and then apply it in batch to the entire folder. For those who frequently need to process office files like Word, Excel, PDF, txt, mastering this type of batch file name processing method can significantly reduce repetitive work and improve daily document management efficiency.


Keyword:Batch clear middle field of file names , batch delete content between two keywords , batch modify file names , batch rename office files , delete text in specified interval of file names
Creation Time:2026-06-24 06:41:17

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

Related Articles

Don't see the feature you want?

Provide us with your feedback, and after evaluation, we will implement it for free!