Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Dec 2004
    Location
    Easley, South Carolina, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Folks:

    I have a large file that was created with an unkown OCR program.

    All lines are terminated with a Hard Carriage Return. Some are terminated with a word split with a hyphen and a Hard Carriage Return.

    How can I remove all the Hard Carriage Returns and the Hard Carriage Returns preceeded with a hyphen.

    I suspect this can be done with a Global Find and Replace, but I don't know what to enter for the Hard Carriage Return.

    Any information would be greatly appreciated.

    Thomas Cox

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts
    Thomas,

    You can search for hard carriage returns aka paragraph marks using: ^p

    Gary

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by thomascox46 View Post
    How can I remove all the Hard Carriage Returns and the Hard Carriage Returns preceeded with a hyphen.
    Try a caret followed by a lower case p (^p). If you are using wildcards, this will not work, and you have to use ^13 instead. In some cases, e.g., text files from a Unix/Linux-based system, you have to use ^13 with or without wildcards.

    You can find more special characters on the Special pop-up when you expand the find dialog using the More button.

  4. #4
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    You can use Find and Replace to sort out the document. First you will need to find REAL end of paragraphs, which is where there should be two consecutive returns.

    So for the first F&R pass search for ^p^p and replace with ZXCV (or any unique code that doesn't appear in the document).
    On the second F&R pass, search for the remaing end of line ^p para marks and replace with either nothing or a space (if required)
    On the third F&R pass, search for ZXCV (or your unique code) and replace with ^p.

    Your document should now be formatted with normal full lines automatically wrapped.

Posting Permissions

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