Can GREPs based on length and sums be modified to account for certain characters

Learn / Forums / General InDesign Topics / Can GREPs based on length and sums be modified to account for certain characters

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #96916
      Candace Cage
      Member

      Me again…just posted for the first time this evening, but I have an additional question. Can GREPs formulas based on length and sums be modified to account for certain characters included in the entries to determine the length and sums?

      My GREPs being used count up character lengths in certain lines, and are as follows:

      =IF(L2>21,”INSRET”,” “) this creates a hard return in my formatting in InDesign if the length is over 21 characters

      =IF(N2>39,,”LOCRET”,”LOCTAB”) this either inserts a hard return or a tab in my formatting if the characters are over 39

      My problem is that both of these work properly, most of the time, but there are occasions when they don’t do what I actually need them to do, based upon the fact that certain entries will fall within those character length parameters, but actually take up more or less space depending upon the letters within… i.e. if I get a Tab result, but there are lots of M’s and W’s, I really need a return since it can’t all fit on one line, and conversely, if there are a lot of I’s and I get a Return result, it really should be a tab.

      So my question is (if you’ve read this far, THANK YOU), can you add on a condition of some sort to the GREP’s to account for if they have, say 3 or more of those characters in the totals and change the result accordingly?

    • #98146
      Graham Park
      Member

      GREP does not allow for this.
      The process you describe above does not sound like a good method to control text anyway, carriage returns and tab.
      If you could post an example we might be able to get a you a workable solution, but not based on GREP

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
>