Batch remove the whitespace at the beginning of each line in a TXT notepad file


TranslationEnglishFrançaisDeutschEspañol日本語한국어Update Time2025-06-07 20:22:41

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!

Large numbers of TXT plain text files exported from systems or automatically generated sometimes contain extra spaces at the beginning of each line, which greatly affects subsequent parsing. When formatting or beautifying text files, leading whitespace can make the document look messy. Cleaning it up improves the browsing experience, and in large-scale storage, removing extra whitespace also saves storage space. Here we explain how to batch delete the whitespace at the very beginning of each line in a large number of TXT notepad files, supporting multiple text formats such as TXT, JSON, HTML, XML, SRT, and CSV.

1. Use Cases

When you have hundreds of TXT plain text files where document content is being written or notes are being organized, extra whitespace at the beginning of lines can cause messy formatting and affect overall aesthetics. We can batch remove the leading whitespace from each line of these files to improve the reading experience.

2. Preview

Before processing:

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

After processing:

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

3. Steps

Open【 HeSoft Doc Batch Tool 】, select【Text Tools】-【Delete Whitespace in Text】.

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

【Add Files】add one or more TXT plain text files that need whitespace removed from the beginning of each line.

【Import Files from Folder】import all TXT plain text files in the selected folder that need whitespace removed from the beginning of each line.

You can view the imported files below.

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

【Operation】check the option below to delete leading whitespace from each line.

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

After processing is complete, click the save location to view the TXT files with all leading whitespace removed.

image-Batch remove the whitespace at the beginning of each line in a TXT notepad file

Creation Time2025-04-09 09:10:01

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!