Double spaces

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Bekah
Posts: 11
Joined: Thu Jan 08, 2004 2:01 pm

Double spaces

Post 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
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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.
Hope this was helpful.............good luck,
Bob
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post 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?
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

The other thing to check is that something hasn't converted it to Unicode.
I choose to fight with a sack of angry cats.
Bekah
Posts: 11
Joined: Thu Jan 08, 2004 2:01 pm

Post 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
Post Reply