https://www.shellhacks.com/sublime-text-remove-empty-lines/
Here is a step by step instruction for how to remove empty lines in the Sublime Text editor:
- Go to the
Find →
Replace
– or – press the Ctrl + H on Windows/Linux or ⌘ Cmd + Alt + F on Mac - Select the ‘Regular expression‘ by clicking on the .* button in the
Find box
– or – press the Alt + R on Windows/Linux or ⌘ Cmd + Alt + R on Mac - In the
Find field, type in:
^\n to delete empty lines excluding the ones that contain whitespaces:
– or – ^(\r|\n\r?) to delete empty lines including ones with whitespaces: - Leave the Replace field empty
- Click on the Replace All button
