If you’re like me and use Dreamweaver as your programming api, you have probably often encountered the problem when retrieving code from the server, only to find that your nicely formatted code has double spaces all over the place.
There are a couple of known methods for quickly removing the breaks including the following:
- Go to Edit->Find and Replace (ctrl+F or cmd+F).
- In the Find box enter “[\r\n]{2,}” (without the quotes).
- In the Replace box enter “\n” (again without the quotes).
- Make sure you check the box for “Use regular expression”.
- Press the Find All button.
Another method, that I prefer to use is to set the code formatting option.
- Go to Edit->Preferences (ctrl+u or cmd+u).
- Click the Code Format Option.
- Under Line break type select your server type.
- Click Ok.
I hope this has helped you. Both these techniques have helped me a lot and saved me a lot of headache when I needed to format many lines of code at once.
Wonderfull, thanks a million. changing the formatting options doesnt solve the problem permanently and i still need to use the find/replace method. Why?
Have you selected the proper line break type? Make sure you’ve selected the correct one for your server. Can you confirm that the setting stayed? I would try closing the application and restarting it as well.
Thanks a bunch this worked for me. Dreamweaver CS4
Thank you. Worked like a charm. Tweeted post.
[…] I finally tracked down a quick solution to clean up these pages, with grateful thanks to this page: Permanently Remove Double Space in Dreamweaver Code View. […]
Thanks for the great HELP file. Two of my students have had this happen to them. I have posted a link on my Facebook page for my students.
Thanks. This saved me time. Had to use this after fetching files with Filezilla