Please Help: Removing Multiple Blank Lines

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
textlearner
Posts: 8
Joined: Sat Sep 09, 2006 2:53 pm

Please Help: Removing Multiple Blank Lines

Post by textlearner »

Hi there,

I am trying to remove multiple blank lines from text which looks like this:

"movie title"
"movie title"
1 blank line
"movie title"
3blank lines
3 blank lines
3 blank lines

"movie title"
2 blank lines
2 blank lines

"movie title"

I have tried search & replace using:

Find what: ^\n
Replace with:

This works, but only removes 1 blank lines, pressing replace again does not remove any of the multiple blank lines.

Any help much appreciated!!
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Replace: \n\n
With: \n
You may need to make multiple passes

Or you can do something like this:
Replace: \n\n\n\n\n
With: \n
Replace: \n\n\n\n
With: \n
Replace: \n\n\n
With: \n
Replace: \n\n
With: \n

How many \n you search for will depend on how many sequential blank lines you have. Personally I would probably do the first simple one mutlitple times. You could make it into a multiplay macro to run more than once.
Hope this was helpful.............good luck,
Bob
textlearner
Posts: 8
Joined: Sat Sep 09, 2006 2:53 pm

Post by textlearner »

Thankyou, works a treat :D
Post Reply