Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Location
    Southern U.K.
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    removing blank lines

    is there a way, using search and replace in word, to remove all blank lines from a word document?

    thanks for any replies.

    paul

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Toronto, Ontario, Canada
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: removing blank lines

    I often do a search and replace when I'm converting a document - i.e. search ^p^p^p and replace with ^p. Is that what you mean?
    Patricia

  3. #3
    New Lounger
    Join Date
    Feb 2001
    Location
    Southern U.K.
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: removing blank lines

    that's it exactly!

    thanks very much!

    paul

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: removing blank lines

    Hi,

    It depends on how the blank lines are stored.

    If they are just hard returns (End of line markers), you can get rid of them replacing pairs of hard returns with a single hard return:
    Replace:
    ^p^p
    With:
    ^p

    The "^p" is the find/replace "shortcut" for a hard return- or a paragraph marker.

    But often (eg, if doing things you've pasted from somewhere else) you might have (many) blank spaces before the end-of-line character.

    Replace:
    ^p
    with
    ^p

    and repeat until no replacements take place.

    Sometimes, when copying things from the web especially, you may have soft line breaks:
    Replace
    ^l
    with
    ^p

    to convert soft breaks with hard breaks before going through the steps above.

    If anybody has copied code from some of the postings into VBA, and it's become a continuous line, then first copy it into word; perform the last replace (^l with ^p) and THEN copy the code into the VBA editor or whatever. If the code being copied has been marked up with "pre" tags (usually the code will have indents) then when you copy that code, it will have soft returns rather than hard returns.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    New Lounger
    Join Date
    Feb 2001
    Location
    Southern U.K.
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: removing blank lines

    even better!

    cheers,

    paul

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: removing blank lines

    One other thing which has been of great interest to me (learned from this amazing lounge) is about white space. This is defined as any combination of regular and non-breaking spaces and tabs. This means that it's possible to find (and replace) a line which has an unknown number of spaces before the hard/soft line break.
    The lounge alerted me to this (thanks) and I found quite a good write up of find and replace codes and definitions in Word help.
    On W2000 I got to it by selecting the Index tab and typing "replacement", without quotes of course. Then select "Find and replace text or formatting", then "Find and replace para marks , page breaks and other items"
    Finally (!) follow the Type a code for the item hyperlink.

    On NT 4 I used the Find tab of Word help and typed find format. This led to Find and replace and the rest is like W2000 help.
    HTH
    Silverback

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •