Can GREPs based on length and sums be modified to account for certain characters
- This topic has 1 reply, 2 voices, and was last updated 6 years, 7 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / 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: GREPs
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?
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
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!