Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Find/Replace Debacle

    I was instructing a friend on how to remove extra spaces before paragraph symbols, but instead of writing "In the find box, enter a space and then a paragraph symbol, and in the replace box, enter just the paragraph symbol," I wrote "In the find box, enter a space, and in the replace box, enter just a paragraph symbol."

    As a result, she has a paragraph symbol between every word. Reversing the process will remove all the legitimate paragraph marks. What to do? Undo is not an option.

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Theoritically, there should now be two Paragraph marks wherever there used to be an actual paragraph break. So you have a three step process.
    1. Search for Doubled Paragraph Marks and replace them with a unique string, e.g. #*&#*&.
    2. Search for Single Paragraph Marks and replace them with a Space.
    3. Search for #*&#*& and replace with a Single Paragraph Mark.

    Of course you'll do all of this on a COPY of the document!

    Hope this works for you.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. The Following User Says Thank You to RetiredGeek For This Useful Post:

    Thomasja (2012-04-13)

  4. #3
    New Lounger
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Fantastic, RetiredGeek. You always come though.

  5. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    You're most welcome.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  6. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    You could use two wildcard Find/Replace operations, where:
    Find = ([!^13])([^13])([!^13])
    Replace = \1 \3
    Find = [^13]{1,}
    Replace = ^p
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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