Block Select Mode and newlines

General questions about using TextPad

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

Post Reply
tshad
Posts: 13
Joined: Sun Jan 06, 2008 6:33 am

Block Select Mode and newlines

Post by tshad »

I just found a great feature I didn't know Textpad had and I have used it for years.

I needed to take the text out of debugger page that had the text in the right side (16 columns) and had no way to copy it. Then someone at worked mentioned it and worked great.

Now I can copy it and paste it onto another page.

Is there a way to quickly say to take out about 3 or 4 newlines so I get about 50 or 60 characters on a line? I can do a del/end/del/end/del an then go to the next line but there is a lot of data.

I also tried to do a find/replace on the last newline but selecting the invisible characters at the end of the page, but I get a message saying:
Cannot find literal string "\n".

It would be nice to be able to do this as well.

Thanks,

Tom
miked
Posts: 54
Joined: Tue Feb 27, 2007 11:17 am

Post by miked »

You were nearly there replacing \n with nothing. You need to check the Regular Expression box in the replace dialogue though.
tshad
Posts: 13
Joined: Sun Jan 06, 2008 6:33 am

Post by tshad »

That worked great.

Is there a way to delete multiple blanks as well?

I have some text such as

aaaa ,bbbbbbbb ,ccccccccc
dddd ,eeee ,fffff

I just want to delete all blanks except 1 between words (or punctuation), such that the above would show as:

aaaa ,bbbbbbbb ,ccccccccc
dddd ,eeee ,fffff

all blanks such that the above would show as:


aaaa,bbbbbbbb,ccccccccc
dddd,eeee,fffff


Thanks,

Tom
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

To remove the spaces:
//The next line uses "_" for a space character.
Search for: _,
Replace with: ,

Replace multiple blank lines:
Search for: \n\n
Replace with: \n
Run this multiple times,

or for specific line counts (3 blank lines)
Search for: \n\n\n\n
Replace with: \n

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
Post Reply