Delete blank lines in a file using Notepad++

If you have a text file or any programming language file and you want to remove all the blank lines that are there in the file you can make use of Notepad++ Text Editor to make this task easier (imagine doing that manually).

Note : You need to download a plugin called TextFX for Notepad++.

Features of this Plugin :

  • Text sorting
  • Text rewrap
  • Column Lineup
  • Fill Text Down
  • Interactive Brace Matching
  • Quote handling
  • Character case alternation
  • Insert counter text down
  • Text to code conversion
  • Ascii Chart
  • Leading whitespace repair
  • Autoclose HTML & braces
  • Numeric Conversion
  • URI & HTML encoding
  • HTML to text conversion
  • Submit text to W3C

Plugin Homepage:

To download the plugin goto Menu -> Plugins → Plugin Manager → Show Plugin Manager and under Available tab look for TextFX, check the checkbox next to it, and install it. Once the plugin is downloaded your notepad++ editor will restart and you must be able to see TextFX on Menu Options.

Steps to remove blank lines
  1. Open the file using Notepad++
  2. Select the text in the file from which you want to remove the blank lines (select all if you want to remove blank lines from the complete file)
  3. Now go-to Menu -> TextFX → TextFX Edit → Delete Blank Lines
  4. That's all!! All blanks lines are now being removed!
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.