Batch remove the leading blank content from each line in the TXT notepad files


Translation简体中文繁體中文EnglishFrançaisDeutschEspañol日本語한국어Updated on2025-04-09 10:46

SummaryA large number of TXT plain text files exported from systems or automatically generated often contain unnecessary spaces at the beginning of each line, which significantly affects subsequent parsing. Additionally, when formatting or beautifying text files, leading spaces make the document appear messy. Cleaning them up can enhance the reading experience, and in large-scale storage, removing excess spaces can also save storage space. Here is an introduction on how to uniformly batch delete the leading blank content from each line in a large number of TXT notepad files, supporting various text formats such as TXT, JSON, HTML, XML, SRT, CSV.


1、Usage Scenarios

When hundreds of TXT plain text files are being drafted or organized, the excess whitespace at the beginning of each line can cause disorganized formatting and affect the overall appearance. We can batch remove the leading whitespace from each line in these files to enhance the reading experience.

2、Preview

Before Processing:

After Processing:

3、Operation Steps

Open 【HeSoft Doc Batch Tool】, select 【Text Tools】 - 【Remove Blanks in Text】.

【Add Files】Add one or more TXT plain text files from which you want to remove the leading whitespace from each line.

【Import Files from Folder】Import all TXT plain text files from the selected folder that need to have the leading whitespace removed from each line.

You can view the imported files below.

【Operation】Check the box below to remove the leading whitespace from each line.

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


Disclaimer: The text, images, videos, etc., on this website are limited to the software version and operating environment used when creating this content. If subsequent product updates cause your operations to differ from the content on the website, please refer to the actual situation!