When dealing with a large number of txt text files, each file contains a chapter from a novel, where the first line of content is always the chapter title. When the number of plain text files is excessive, the file names need to be modified according to the first line title content of the book chapter in each file. Opening each file one by one to view the title and then renaming it not only wastes time but also reduces our operational efficiency. Below is an introduction on how to batch replace the file name of a txt file with the first line content from that text file.
1. Use Cases
Rename txt or plain text files by using any number of characters from the first line of the file as the new file name.
For example: three plain text files named Novel Chapters 1.txt, Novel Chapters 2.txt, Novel Chapters 3.txt
You need to replace the file names with the titles from the first line of each article: The turning point of fate, Misty mystery, The Call of the Brave.
After the renaming is complete, they will become The turning point of fate.txt, Misty mystery.txt, The Call of the Brave.txt
2. Preview of Results
Before Processing:


After Processing:


3. Steps
Open ć HeSoft Doc Batch Tool ć, select ćFile Nameć - ćRename Text Files Using First Lineć.

ćAdd Filesć Add single or multiple notepad/plain text files to be renamed.
ćImport Files from Folderć Import a folder containing a large number of notepad/plain text files to be renamed.
You can also drag files directly into the area below. Then click Next.

ćHow many characters to capture from the beginning?ć 1 letter equals 1 character, enter the number of characters to use. Leave empty to use the entire first line.

After processing is complete, click the save location to view the renamed text files.
