3 Replies Latest reply on Feb 20, 2013 5:16 PM by David A E

    Seeking help with GREP expression

    David A E

      I am working with InDesign's GREP feature for the first time. I'm learning the codes but I'm still pretty lost. I'd appreciate some assistance creating an expression.

       

      The document is a test. I'd like to reflow each question onto it's own page.

       

      The individual questions look more or less like this:

       

      LM_CC1234

      ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶

      Olenisquia dis etur rem quia dollenis maximus est?¶

      A»plicius perovit¶

      B»alit ducit fugia¶

      C»vel invel ius¶

      D»offic tem aboriae¶

       

      I'm open to different possibilities, but right now I'm trying to search for the spot that's either 11 or 12 characters (including line breaks) before the square dingbat (hexadecimal x25A0). The LM_CC1234 identifier sometimes uses a format with one more letter (like SLM_CC1224) hence the 11 or 12 character count.

       

      Once InDesign has found the spot, I want to insert a carriage return (hexadecimal xD) in that spot throughout the document.

       

      Thank you for your time!

        • 1. Re: Seeking help with GREP expression
          Jump_Over Level 5

          Hi,

           

          Did you consider startParagraph property to use?

          If      LM_CC1234

          or     LM_CC1234

                  ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶

           

          are separate paragraphs -- this option could be set to StartParagraph.NEXT_PAGE,

          so no GREP needed here.

           

          hope...

          • 2. Re: Seeking help with GREP expression
            David A E Level 1

            I'm sorry, I'm not sure I understand. Are you talking about using a script?

             

            I tried to indicate the invisible tab and pararaph characters to the sample. All of the questions have paragraph breaks in them. In the sample question each line has one, which might mean that each line would be seperated by a bage break if I'm understanding you correctly.

            • 3. Re: Seeking help with GREP expression
              David A E Level 1

              Jump_Over! Thank you for your help! After my last response I kept working on your idea and I was able to get to a solution.

               

              The LM_CC1234 numbers are in a unique paragraph style that's only used once per question. I was able to change the Keep options in the paragraph style sheet to start paragraph: on next page.

               

              I'd forgotten that was a possibility until your suggestion. Much simpler than creating an expression. Thank you for your help!