Page 1 of 1

Double spaces

Posted: Mon Nov 27, 2006 6:51 pm
by Bekah
C-H

Peace to you, and thank you for the great tool, TextPad.

I am wondering why every so often I open one of my hand-coded XHTML files to find it somehow has been double spaced. This offends my sense of aesthetics, and takes my time to return the file to normal, crisp single-spaced code.

I am not a power user, just know how to do the simple things with TextPad. I find it the perfect tool for a coder who is also an author.

Any clues as to why a few (not all) of my files get double spaced out?

Thanks in advance,
Bekah

Posted: Mon Nov 27, 2006 9:11 pm
by Bob Hansen
Not sure what is causing the problem, but you should be able to fix the results with Search/Replace with Regular Expressions

1. Move the cursor to the beginning of your document.

2. Do Search>Replace
Search for \n\n
Replace with \n

3. Make sure you have a checkmark in the box for Regular Expressions.
Click on Replace All.

Posted: Mon Nov 27, 2006 9:52 pm
by SteveH
Any clues as to why a few (not all) of my files get double spaced out?
Are those files making any sort of round-trip through another application such as getting run through some sort of XML prettifier?

Posted: Tue Nov 28, 2006 10:32 pm
by talleyrand
The other thing to check is that something hasn't converted it to Unicode.

Posted: Sun Dec 10, 2006 9:07 pm
by Bekah
CHET-NUN

Thank you for the help.

The regular expression replacement suggestion worked great.

But, I would add this caution:
Select the text/code you want to remove the double spaces from, else you remove important whitespace from elsewhere in your file. My XHTML headers and footers are clearer when I put blank lines between sections.

How did the mysterious double spaces appear? My best guess is that sneakernetting files between windows and linux, and using various editing tools may be the culprit.

I am glad to know it probably is not TextPad doing it.

Grateful for the help, I am
Bekah