When system- or tool-generated text files contain extraneous leading whitespace, these spaces impact file readability and processing efficiency. In collaborative work, leading whitespace disrupts uniformity of document formatting and results in unnecessary revisions. Furthermore, excessive whitespace wastes storage space—especially when handling a large number of files. Removing leading whitespace makes file content cleaner and allows important information to be presented quickly. Below we explain how to batch remove leading whitespace from multiple TXT notepad files, supporting various text formats including TXT, Json, HTML, XML, SRT, and CSV.
1. Use Cases
In team collaboration or project management involving many TXT notepad files, large amounts of blank content may be generated at the beginning of file content. Here, we can batch remove whitespace at the start of all plain text TXT files, reducing unnecessary revisions and maintaining format consistency.
2. Preview
Before:

After:

3. Steps
Open【 HeSoft Doc Batch Tool 】, select【Text Tools】-【Remove Whitespace in Text】.

【Add Files】Add one or more plain text TXT files that need leading whitespace removed.
【Import Files from Folder】Import all plain text TXT files from a selected folder.
Imported files can be viewed below.

【Actions】Check the option below to remove all leading whitespace from the content.

After processing, click the save location to view the TXT notepad files where the leading whitespace has been successfully removed.
