Many corporate documents, order records, scanned copies, and reports often retain classification codes at the end of their filenames, such as city, department, or project abbreviations. When dealing with a large volume of files, manually creating folders based on suffixes and moving files is highly inefficient. This article uses HeSoft Doc Batch Tool as an example to explain how to batch categorize files by the last few characters of their filenames, allowing files such as txt, docx, xlsx, and pdf with the same suffix to be automatically placed into corresponding folders.
If you often need to organize downloaded materials, orders exported from business systems, customer profiles, scanned documents, or report files, you may encounter a typical situation: the file names already contain classification information, but all files are still piled in the same directory. For example, a batch of files starts with numeric codes and ends with suffixes like LON, PAR, NYC, SYD, TYO. Files with the same suffix should ideally be grouped together, but manual sorting requires checking each one individually, which is very time-consuming.
The method introduced in this article uses the office software HeSoft Doc Batch Tool to convert file name suffixes into a basis for folder classification. You simply need to import the files, specify "classify by the last few characters," and enter the number of characters to capture. The software will then automatically place files with the same suffix into a folder of the same name. For office scenarios that require batch file processing and reducing repetitive labor, this method is more stable than manual drag-and-drop and is also more suitable for long-term, repeated use.
Applicable Scenarios: Batch Archiving with Fixed Codes at the End of File Names
Automatic categorization by file name suffix is particularly suitable for scenarios with relatively standardized file naming. For instance, sales orders ending with region codes, financial vouchers ending with account abbreviations, HR documents ending with department codes, project files ending with project numbers, and exported documents ending with business type identifiers. As long as these classification characters are located at the end of the file name and have a consistent length, they can be processed in batches.
For example, the LON in 10102271LON.txt might represent London or some internal classification, the PAR in 10103956PAR.txt might represent another category, and the NYC in 10179839NYC.txt is yet another separate category. As the number of files increases, manually searching for LON, PAR, NYC and then moving the files is unreliable and prone to missing some. By using a tool, you can delegate the rule "same suffix" to the software for execution.
This logic applies not only to txt text files but also to Word documents (doc, docx), Excel spreadsheets (xls, xlsx), PDFs, PPTs, images, and more. The software focuses on the file name pattern, not the file content. Therefore, as long as the file names follow a pattern, batch classification and organization can be performed.
Effect Preview: Suffix Information Hidden in File Names Before Processing
Before processing, all files are located in a single directory. The user can see that each file name has a different 3-letter code at the end, but the folder structure does not reflect these classifications. Such a directory might be acceptable when there are few files, but it affects search efficiency when the number of files is large.

As seen in the screenshot, the red highlights emphasize the classification codes at the end of the file names. For example, LON, PAR, SYD, NYC, TYO, etc., all appear before the extension. The key operation in this article is to let the software read these end characters and create corresponding folders based on them.
Effect Preview: Same Suffixes Grouped into Same-Name Folders After Processing
After processing is complete, multiple folders named after the suffixes appear in the directory, including LON, NYC, PAR, SYD, TYO. Files with the same suffix are placed into the corresponding folder, making the file structure clear.

This result offers two direct benefits: First, finding files is faster. For example, if you need NYC type files, you just open the NYC folder; second, subsequent delivery is more convenient. You can package, send, or back up by folder without needing to filter files again. For office workers who frequently handle bulk materials, this automatic categorization can significantly reduce repetitive operations.
Operation Steps: Batch Grouping Files with the Same Name Suffix
Step One: Open "Classify Files by Name" in File Organizer
After launching HeSoft Doc Batch Tool , first select File Organizer in the left navigation bar. This is the entry point for functions related to file archiving, classification, and moving. Once inside, you can see various file organization tools, among which you need to select Classify Files by Name.

The reason for choosing this function is that the basis for this classification is not the file extension or the file creation time, but the file name itself. The function description in the software interface also indicates that this tool is used to "classify all files in batches by their file names." For automatically grouping documents with the same file name suffix, this is the most direct entry point.
After this step is completed, the software will enter a wizard page. At the top of the interface, you can see the process nodes: Select records to process, Set processing options, Set save location, Start processing. Following the wizard reduces the probability of missing settings.
Step Two: Import the Files to be Sorted
On the "Select records to process" page, click Add Files or Import Files from Folder at the top. If the files are stored centrally in one directory, it is recommended to use "Import Files from Folder," as this allows you to add all files in the directory at once, avoiding repetitive selections.

After importing, the interface will display file information in a table format, including name, path, extension, creation time, and modification time. In the screenshot, the record count is 20, indicating that a group of files to be processed has been imported in batch. At this point, you should focus on checking the "Name" column to confirm that the file names indeed contain the suffixes used for classification, such as LON, PAR, NYC, SYD, TYO.
If files that do not need processing are mixed into the list, you can delete the corresponding records in the operation column; if the import result is incorrect, you can click "Clear" and import again. After confirming everything is correct, click Next at the bottom to proceed to rule settings.
Step Three: Set the Classification Method to By Last Characters
On the "Set processing options" page, the software provides multiple ways to classify files by name. Since the classification codes in this example are located at the end of the file names, select Classify by the Last Few Characters.

After selecting, enter 3 in the "Quantity" input box. This tells the software to read 3 characters from the end of the main file name as the classification name. For the example files, 10102271LON.txt will read LON, 10103956PAR.txt will read PAR, and 10179839NYC.txt will read NYC. The read results will be used to generate folder names.
If your file naming rules differ from the example, you need to adjust the quantity. For instance, if the file name ends with a 2-digit department code like "HR" or "IT," fill in 2; if it ends with a 4-digit project number like "A001" or "B002," fill in 4. The key is to make the entered quantity consistent with the suffix length.
The screenshot also shows a "Letter Case Conversion" option, including Default, Convert to Uppercase, Convert to Lowercase. The example file suffixes are originally uppercase, so choosing Default is fine. If your files have inconsistent letter casing, you can choose a conversion method according to your actual organization standards to prevent similar files from ending up in different folders due to case differences.
Step Four: Continue by Setting the Save Location and Executing the Process
After finishing the processing options, click Next. Following the interface flow, you will need to set the save location next. It is recommended to choose a folder specifically for outputting results, especially when using this rule for the first time, so you can more conveniently check if the classification results meet expectations.
After setting the save location, proceed to the Start Processing stage. The software will create corresponding folders based on the 3 characters at the end of each file name and move or organize the files into the corresponding directories. After processing, you will see the folder structure with LON, NYC, PAR, SYD, TYO as shown in the example.
The core value of this step is batch execution. During manual operation, each file requires individual judgment; with software processing, as long as the rules are set correctly, dozens or even hundreds of files can be archived in one go according to the same rule.
Frequently Asked Questions or Notes
1. Must the suffix length of file names be consistent?
It is recommended that the suffix length be consistent for files in the same batch. Because a fixed quantity needs to be entered here, the software will capture characters from the end based on that number. If some files have a 3-character suffix and others a 2-character suffix, they are not suitable for direct processing with a single quantity. It is suggested to split the batch first or unify the naming rules.
2. Will spaces at the end of file names affect classification?
If there are extra spaces or abnormal characters in the file name, it may affect the capture result. Before batch processing, it is recommended to check whether the file names are standardized, especially those exported from different systems. If necessary, you can clean the file names first before classifying by suffix.
3. Can this be used for office files like docx, xlsx, pdf?
Yes. This article demonstrates with txt files, but the logic of classifying by file name is not limited to txt. Word's doc, docx, Excel's xls, xlsx, PDF documents, PPT files, and image materials can all be organized using the same approach, as long as their file names contain fixed classification characters at the end.
4. Why not choose "Classify by File Extension"?
Classifying by extension is suitable for separating different formats like txt, docx, pdf; however, this article's requirement is to classify by file name suffix. For instance, LON.txt, PAR.txt, NYC.txt are all txt files. If classified by extension, they would all go into a txt folder, failing to distinguish between LON, PAR, and NYC. Therefore, you should choose "Classify Files by Name" and use the last character rule.
5. Do I need to back up before processing?
For important materials, it is recommended to keep the original folder or set the output location to a new directory. This way, even if the rule settings are incorrect, you can quickly roll back. Batch processing tools can improve efficiency, but the prerequisite is to confirm that the classification rules are correct first.
Summary: Replacing Manual File Filtering with Suffix Rules
Automatically grouping documents with the same file name suffix is essentially about converting naming rules into a folder structure. The "Classify Files by Name" function provided by HeSoft Doc Batch Tool allows users to complete batch organization through simple settings: import files, choose to classify by the last few characters, fill in the quantity, set the save location, and then start processing.
If your file names also contain end codes like LON, PAR, NYC, you no longer need to search and drag one by one. It is recommended to first select a few samples to verify the classification effect, and after confirming it is correct, process the entire folder. This reduces the risk of errors and delegates large amounts of repetitive file organization tasks to the office software for automatic completion.