Page 1 of 1

Remove blank lines in format action

Posted: Wed Apr 29, 2009 4:48 pm
by ted.habermann
I am dealing with XML that is generated by a program that inserts blank lines in various places in the file. It would be nice if the Format and Indent Command removed these

Re: Remove blank lines in format action

Posted: Wed Apr 29, 2009 5:07 pm
by sorin_ristache
Hello,

The Format and Indent action removes the blank lines if they are not included in an element that has the atribute xml:space="preserve" and if the option Preserve empty lines is not selected in Preferences -> Editor -> Format -> XML (by default it is selected). Are the blank lines included in an element listed in the Preserve Space Elements list in Preferences -> Editor -> Format -> XML?


Regards,
Sorin

Re: Remove blank lines in format action

Posted: Sun May 31, 2009 5:06 am
by ted.habermann
The preferences setting deals with this very nicely... Too many options to keep up with!

Thanks,
Ted

Re: Remove blank lines in format action

Posted: Wed Oct 29, 2014 1:27 am
by kiai
I'd like to remove blank lines while keeping long lines from breaking. Is there an option for that?
thanks!

Re: Remove blank lines in format action

Posted: Wed Oct 29, 2014 3:49 pm
by adrian
Hi,

If you just want to remove the blank lines and don't need to format the document, simply use Find > Find/Replace to remove them:
Text to find: \n\s*\n
Replace with: \n
Regular expression enabled
Press Replace All to eliminate all blocks of blank lines.

Regards,
Adrian