Link to home
Start Free TrialLog in
Avatar of sabecs
sabecs

asked on

Remove Blank Lines - Dreamweaver MX

Hi,
I have many files in Dreamweaver MX that have multiple blank lines inserted for no apparent reason and would like to remove them.
Does anyone know a simple way to do this; I tried to download an extension but could not get it to work.

Not sure why this is occurring, but from what I have read it may have something to do with uploading and downloading files from Windows to Linux.

Please help, I have some files now that have upto 50 blank lines between code.
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

You need to open that files and remove the blank lines yourself personally..

Yet, since it's in HTML format, the blank lines will not be appears when it's loaded into browser. So, basically you can ignore those blank lines..
Avatar of sabecs
sabecs

ASKER

Thanks for your Feedback ryancys, but I am talking about hundreds of files; it is not feasible to remove the blanks lines manually.
I'm affraid you don't have other alternatives, for file content security also, you need to edit the file manually, if you really want to remove the blank lines.

Else, you need to have a file editor (either is self-developed or any commercial one), which will open the selected files, and then remove any lines that is "empty". That's the only way i can think off.. yet before i do that i will make a backup, of course.

regards
When you say 'blank lines', do you mean totally empty lines in the source-code, or lines like this:

<p>&nbsp;</p>

Either way, if you have all the pages organised into a DW Site, you could use the Find/Replace tool sitewide. The tool can use regular expressions

To get rid of blank lines (or lines containing only spaces) in source, replace
<Shift+Enter>
\s*<Shift+Enter>

with

<Shift+Enter>

To get rid of lines with only <p>&nbsp;</p> (<p> tag may have attributes), replace

<Shift+Enter>
\s*<[pP][\s\S]*>&nbsp;</[pP]>\s*<Shift+Enter>

with

<Shift+Enter>

I'd suggest running this on a test page first, to make sure you get the results you expect.
Avatar of sabecs

ASKER

Thanks again for your feedback; by "blank Lines" I mean totally empty lines in the source-code.
I have tried "Havin it" suggestion by replacing  \s*<Shift+Enter> with <Shift+Enter> but had not luck, came back with not found in current document.

As an example I have one document that has apporx 16,000 lines in it with only about 300 lines of actual code.
ASKER CERTIFIED SOLUTION
Avatar of Havin_it
Havin_it

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sabecs

ASKER

Thanks 'Havin_it' for your help, I tried again but this time ticking the box to use regular expression and all works perfectly.
You're most welcome. Sorry I forgot to mention the checkbox bit...!

Happy New Year!