Cleaning code in Dreamweaver

Written by  in K2Joom Blog and has been read 255 times.

When I am editing html or php files when creating my templates, I use Dreamweaver. I have had it for years and it has always worked for me, but there has always being an annoyance.

More often than not, when the file is downloaded from the server to local copy and then opened for editing, a mass of empty lines are added between each code line, bulking out the code.
My OCD kicks in and I have to clear up these blasted blank lines, but it is tedious and takes a lot of time, now I have found a solution.

So if you use Dreamweaver and wish to remove the excess blank spaces, give this a try.

  1. Open the file in Dreamweaver
  2. Press CTRL + F to open the Find and Replace tool
  3. Select Current Document in the Find In selector
  4. Select Source Code in the Search selector.
  5. Make sure the checkbox calle Use Regular Expression is enabled.
  6. In the Findbox, type:  
    • [\r\n]{2,} 
  7. In the Replace box, type: 
    •  \n
  8. Press the Replace All button.

After a few seconds, depending on how severe the clean up is, all those rogue blank spaces will be gone.

Hope someone finds this useful.

Written on Saturday, 28 January 2012 08:46
Tags Used:
1 subscriber

Comment subscription

Receive email notification when a new comment is added to this item.

1 comment

  • Comment Link sprinkleporkfloss Sunday, 19 February 2012 08:02 posted by sprinkleporkfloss

    The cheats way to do the same thing.... open notepad and copy all the code to it. Copy THAT to Word - find and replace all instances of ^p and recopy cleaned version back to notepad then to Dreamweaver. Works for me...


Leave a comment

* Indicates required information.
Basic HTML code is allowed.

Simon Wells

Simon Wells

Founder of K2Joom, the original K2 fan site, now providing K2 templates and Extensions.
Simon is also author of Simon Says the official K2 document site.

Website: k2joom.com E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
JoomlaPriase awesome templates and tools
Joomla for iPad
Admin Templates
and Tools
K2Joom Highly Recommends JoomlaBamboo
Joomla Templates
Extensions and
1st Class Service
Joomla WordPress and Drupal Training
World Leading
Open Source
Training

Preferred Payment

paypal-verified

Newsletter Sign Up