Dreamweaver – Find and Replace Empty Lines

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

  1. Create backup copy of your document (things happen…)
  2. Open the document you need to change.
  3. Open Find and Replace:  Click CMD + F (Mac) or CTRL + F (PC).
  4. In the Find and Replace window change the following:
    1. Find in: Current document
    2. Search: Source Code
    3. Find: [\r\n]{2,}
    4. Replace: \n
    5. Options: Use regular expression
    6. Click Replace to see how it works, click Replace All to finish

Dreamweaver - Replace Empty Lines

print

Leave a Reply

Your email address will not be published. Required fields are marked *