4 Replies Latest reply on Jun 23, 2011 7:28 AM by lucykafka

    grep help

    lucykafka

      here is the issue:

       

      I have many text frames with product info (it is a catalog).  They will always stay separate stories, just one of these cases per story.

       

      product name, styled as "product name",  is at beginning of the story (not always the very first line however, but always same paragraph style)

       

      there is bunch of other product info text, in which product info might appear again inside a paragraph.  I need to find and select the product name, so I can apply character style to it.

       

      Example of a story, text frame:

       

       

      "Green Hair Spray^p

      our bestseller^p

      made in US^p

      voluptat optam Green Hair Spray que solorum blah blah etc on and on "

       

       

      I need to make the "Green Hair Spray" bold or color using character style so it would stand out.  There might be other capitalized words in the paragraph so I cannot just search for words that start with caps.  I need to search for words that appear *in front of this fraze, in that certain style*

       

       

      I am happy to pay for this grep if that is something that needs to be created from scratch, but maybe this comes up for other people, and can be located elsewhere?

       

      thanks for grep or any other advice on this!

        • 1. Re: grep help
          JohnDevlon Level 1

          Hi,

           

          Di you try the standard search and replace options?

          You can search for any paragraph style and apply a character style. You can also search for any word(s) and apply a character style to it. No scripting or grep needed.

           

          Hope this helps

           

          John

          • 2. Re: grep help
            lucykafka Level 1

            well, that will not work for me since the product name appears second time inside a paragraph, not sytle in any special way.  If there was a way to select it I would, and assign a paragraph style to it and would be good.

             

            I need a grep that would learn the product name from the line at beginning of the story (where it *is* styled differently) and find (and select) it in a following paragrah of the story, where it is buried in bunch of other text witht he same (body) style.

            • 3. Re: grep help
              Green4ever Level 3

              Hi,

               

              Grep will not learn from the first line of your story. It will match with pattern what you are giving. I think a script may solve your problem.

               

              "Green Hair Spray^p

              our bestseller^p

              made in US^p

              voluptat optam Green Hair Spray que solorum blah blah etc on and on "

              I assume that "Green Hair Spray" is a product name in this story, and it is styled with a paragraph style "product name" (as you said).

               

              1. Find this parapgraph style and get its content.(use .+ in gerp to avoid paragraph return)

              2. And now set this is as your search the content.

              3. Find this content and apply some character style as you want.

               

              Good luck... :-)

               

              ------

              Green4ever

              • 4. Re: grep help
                lucykafka Level 1

                well, how do I get it to *match with pattern" of the "name of product" paragraph style?


                I know how to search for the product-name style, of course, and then I have been copying and searching in rest of copy product-name by product-name. (I got hundreds product names)

                 

                you say "1. Find this parapgraph style and get its content.(use .+ in gerp to avoid paragraph return)

                 

                is "get its content" in the drop down menu?  or what is the script for it?

                 

                thanks again