0 Replies Latest reply on Jun 18, 2014 2:44 PM by mtinnin

    Using GREP for Address Formatting Varying Addresses

    mtinnin

      I create pre-addressed wedding envelopes for my clients. They provide me with a list of their addresses in a word document, and I lay them out in InDesign with each page being one envelope. (So I can export as a pdf and print all 100 or so envelopes in one swipe.)

       

      The problem is, I'm getting more and more requests for more dynamic addresses. For example, lets say they want something like this:

       

      Mr. & Mrs. Smith

      1 3 4 5   M A I N   S T R E E T

      NEW YORK, NEW YORK

      87996

       

      Solution 1: Use Line Styles

       

      For example:

      Line 1: Style A
      Line 2: S T Y L E  B

      Line 3: STYLE C

      Line 4: Style D

       

      This would typically work, except sometimes the addresses have 4 lines instead of 3, making some addresses look like this:

       

      Mr. & Mrs. Smith

      1 3 4 5   M A I N   S T R E E T

      APARTMENT - 7B

      New York, New York

      87996*

       

      *hint: It thinks this is line 1 again.

       

      Instead of the desired result:

       

      Mr. & Mrs. Smith

      1 3 4 5   M A I N   S T R E E T

      A P A R T M E N T  - 7 B

      NEW YORK, NEW YORK

      87996

       

       

       

      Also, it would require replacing every return with a forced line break (attainable, but still.)

       

      Solution 2: Use Nesting Styles

      This *might* work, but I can't tell it to stop the nesting style with a line break/return, only with specific characters (which I would have to insert line by line and negate the whole point.

       

      Solution 3: Use GREP

      This is a foreign language from another planet and I CANNOT figure it out. I can set character styles no problem, but telling ID in GREP when to apply them is a mystery to me. HELP!

       

       

      BobLevine EugeneTyson @P_Spier << you guys are my heroes!  InDesign