1 Reply Latest reply on Dec 26, 2012 5:09 AM by Peter Spier

    grep code help (removing spaces)

    francisjayaraj Level 1

      text1(..................................)

      text  2 (..............................)

      text  3 (...............................)

       

      I need a help with getting a grep code.

      i have a document from my client in word doc. it is a 200 pages document. The client is not well good in word so what he has done is without giving paragraph break, he used space (spacebar spaces) to get the line to next line

       

      the (....) represents the spaces...

       

      i need a grep code to find these spaces and replace with paragraph break. but the spacing between the text should not be moreoved, like text (space) 1, text (space) 2...

       

      thanks

      francis

        • 1. Re: grep code help (removing spaces)
          Peter Spier Most Valuable Participant (Moderator)

          I'm not sure I understand your question entirely, but I think I do. But just in case, try this on a copy of the file:

           

          Find \s\s+ and replace with \r

           

          This will find any combination of two or more whitespace characters (including tabs, so it may not be suitable for use in a document with tabular data) and replace them with a paragraph break. If you want to find just spacebar spaces you can substitute two taps on the spacebar for \s\s in the find field.