6 Replies Latest reply on Apr 29, 2016 10:28 PM by Laubender

    Find and replace grep Question/

    cbishop01 Level 2

      I'm setting up Paragraph styles and i am trying to change anything with <CR> into a ^p.  How do i do this with a grep string?  i'm wanting to add this grep string into the grep style inside the paragraph styles. 

        • 1. Re: Find and replace grep Question/
          Laubender Adobe Community Professional & MVP

          With GREP Styles you cannot change text, but the formatting of text.
          You'll need a Find/Change action with either TEXT or GREP Find/Change.

           

          Uwe

          • 2. Re: Find and replace grep Question/
            pixxxel schubser Level 5

            Full ack with Laubender

            Furthermore: for Grep question mostly the best way is to show some sample text.

             

            What is if spaces before or behind <CR> exists?

            What is if return before or behind <CR> exists? Is the goal a double return - or not?

             

            Like a shot in the sky:

            At first you can try this Grep (find&replace):

            \s?<CR>\s?

            change to:

            \r

             

            Perhaps this helps a little bit.

             

            • 3. Re: Find and replace grep Question/
              cbishop01 Level 2

              I'll try that.  As for the spaces before and after.  Depending on how clean the Document i receive from our client is(they usually are a mess) there is a space before and after.

              • 4. Re: Find and replace grep Question/
                cbishop01 Level 2

                I cannot enter this in the paragraph styles>Grep Styles menu.  If i do a find and replace everything is ok thats what i do now.  I was just seeing if i could automate it a little more. 

                • 5. Re: Find and replace grep Question/
                  Peter Spier Most Valuable Participant (Moderator)

                  No. GREP styles can only apply a defined character style to matching text. They cannot replace, add, or delete characters.

                  • 6. Re: Find and replace grep Question/
                    Laubender Adobe Community Professional & MVP

                    cbishop01 wrote:

                     

                    I cannot enter this in the paragraph styles>Grep Styles menu. If i do a find and replace everything is ok thats what i do now. I was just seeing if i could automate it a little more.

                    If it were only for pure visual representation on paper—pure print workflow/throw the files away after publishing—there would be a workaround: Create a one character* font with the substituted glyph(s), do a character style with that font, substitute e.g. the "R" in <CR> with ^p (drawn as one character) and hide the surrounding <C and > with a character style, that is set to 0.1 pt with no fill and no stroke.

                     

                    But not in this case, because you'll need to use the real meaning of the code in a non-printing workflow.

                    Either someone has to copy/paste the contents from a PDF file uploaded or sent by mail or simply because the text is repurposed for the web, EPUB or an XML workflow and should stay functional. ( My assumption )

                     

                    * see IndyFont here Indiscripts :: IndyFont

                     

                    Uwe