Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-20-2017, 01:24 PM
Ziad El Hachem Ziad El Hachem is offline Select and Delete 2 lines after each blank line Windows 7 64bit Select and Delete 2 lines after each blank line Office 2003
Novice
Select and Delete 2 lines after each blank line
 
Join Date: Mar 2017
Posts: 2
Ziad El Hachem is on a distinguished road
Question Select and Delete 2 lines after each blank line

Dear all,

I have large amounts of text that can be seen as the following pattern:

Good Line
(empty line)


Bad Line
Bad Line
Good Line
(empty line)
Bad Line
Bad Line

Etc...
I would really like to delete all blank lines along with the next 2 bad lines. I only know this is possible in VBA! but I am not proficient in it (my experience is with excel VBA)
Reply With Quote
  #2  
Old 03-20-2017, 02:55 PM
slaycock slaycock is offline Select and Delete 2 lines after each blank line Windows 7 64bit Select and Delete 2 lines after each blank line Office 2013
Expert
 
Join Date: Sep 2013
Posts: 256
slaycock is on a distinguished road
Default

Can you describe what the good and bad lines look like a little better.
Reply With Quote
  #3  
Old 03-20-2017, 03:46 PM
macropod's Avatar
macropod macropod is offline Select and Delete 2 lines after each blank line Windows 7 64bit Select and Delete 2 lines after each blank line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Ziad El Hachem View Post
I would really like to delete all blank lines along with the next 2 bad lines. I only know this is possible in VBA!
You almost certainly don't need VBA for this; a wildcard Find/Replace would most likely do the job, where:
Find = ([^13^l])[^13^l]{1,}
Replace = \1
This assumes there are no stray spaces, tabs, etc. in your 'blank' lines.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 03-21-2017, 08:34 AM
Ziad El Hachem Ziad El Hachem is offline Select and Delete 2 lines after each blank line Windows 7 64bit Select and Delete 2 lines after each blank line Office 2003
Novice
Select and Delete 2 lines after each blank line
 
Join Date: Mar 2017
Posts: 2
Ziad El Hachem is on a distinguished road
Default

what does ^| do?
the find search, even using wildcards is not working...

A sample of the texts I am trying to arrange (standard youtube caption files):

1
00:00:04,350 --> 00:00:07,609
This tutorial will show how to seamlessly transfer

2
00:00:07,609 --> 00:00:11,059
a model from Revit structure to ETABS

3
00:00:11,059 --> 00:00:14,559
at then back again to Revit using
Reply With Quote
  #5  
Old 03-21-2017, 06:55 PM
macropod's Avatar
macropod macropod is offline Select and Delete 2 lines after each blank line Windows 7 64bit Select and Delete 2 lines after each blank line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Ziad El Hachem View Post
what does ^| do?
Nothing that I'm aware of - it's not in the expression I posted... ^l is not ^|. ^l is a manual line break.
Quote:
Originally Posted by Ziad El Hachem View Post
the find search, even using wildcards is not working...
It might if you used the actual Find expression I posted! If not, the spacing may simply reflect your paragraph space before/after settings, which no amount of Find/Replace could fix. If you attach an actual document to a post, with some representative data, we could provide more advice. You can do that via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
blank find expand

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select and Delete 2 lines after each blank line Line Numbering & Blank Lines Ephasa Word 9 04-30-2020 02:09 PM
Quickly select lines of certain colour RFoudy PowerPoint 27 09-09-2014 12:35 AM
Select and Delete 2 lines after each blank line remove blank lines in between jolinchew Excel 4 08-01-2013 06:09 AM
Select and Delete 2 lines after each blank line Getting blank lines instead of supressed lines. Welshie82 Mail Merge 2 11-14-2011 01:41 AM
Select and Delete 2 lines after each blank line How to turn all blank lines into non-blank for legal forms sieler Word 3 04-12-2009 01:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft