Dreamweaver has excellent automated code cleanup functions that handle just about anything based on your code formatting preferences but it does not handle empty lines. To do so you need to use regular expressions.
Related reading: Dreamweaver Using regular expressions – Part 1: Understanding the basic building blocks
Steps to replace Empty Lines In Dreamweaver
- Create backup copy of your document (things happen…)
- Open the document you need to change.
- Open Find and Replace: Click CMD + F (Mac) or CTRL + F (PC).
- In the Find and Replace window change the following:
- Find in: Current document
- Search: Source Code
- Find: [\r\n]{2,}
- Replace: \n
- Options: Use regular expression
- Click Replace to see how it works, click Replace All to finish