Page 1 of 1

Block Select Mode and newlines

Posted: Thu Apr 03, 2008 12:40 am
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

Posted: Fri Apr 04, 2008 12:30 pm
by miked
You were nearly there replacing \n with nothing. You need to check the Regular Expression box in the replace dialogue though.

Posted: Mon Apr 14, 2008 11:47 pm
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

Posted: Tue Apr 15, 2008 1:37 am
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
-----------------------------------------