Replacing extra blank lines

General questions about using TextPad

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

Post Reply
Geoffrey Baker

Replacing extra blank lines

Post by Geoffrey Baker »

How can one find and get rid of multiple blank lines in a replacement operation?

Something like replace

[\n]+

with

\n

???

any help would be appreciated.

thanks

Geoffrey Baker
Andreas

Re: Replacing extra blank lines

Post by Andreas »

unfortunately, +, * and so on do not work together with \n

search for \n\n and replace with \n
repeat until no replacements occur.
Ken Grubb

Re: Replacing extra blank lines

Post by Ken Grubb »

regex Find ^\n\n
Mark All
Close
Edit, Delete, Bookmarked Lines

I have this set up in a Macro. It's probably also a good idea to include Search, Clear All Bookmarks BEFORE the Find.
Geoffrey Baker

Re: Replacing extra blank lines

Post by Geoffrey Baker »

thanks to all;

Ken, yours works very nicely and cleans them all at once. I've FINALLY created a macro that will let me clean *everything* except valid email addresses out of a file and then get rid of the spacing as well. very handy.

Geoff
Post Reply