This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I'd like to count the number of characters inputted from a text box/update a formula based on the number of characters. How do you do that?
What i am trying to do is based on what characters are in a field, count those characters. But the characters could change based on the input. So in one instance I could be counting - and \ and in another could be counting | and ,. Or in another counting all four. So the first step would be to say what characters to count and then based on that, count those characters.
Yeah so I have the regex countmatches written. How would I update this dynamically? Say the delimeters were | and - then update the regex count matches formula to REGEX_CountMatches([Field1], "\||-"). Then if the delimeters are | and - and , then make it REGEX_CountMatches([Field1], "\||-|,"). Or if just - then, REGEX_CountMatches([Field1], "-")
I tried using the dynamic formula macro from CReW but not sure how to update the pattern part of the formula with it.
How are you defining which characters are counted? There are qualifiers in Regex that would count all non-alpha, non-numeric characters, for example Regex_Countmatches([Field],"\W").
Or, are you looking for user input into what to search for with each run? If that's the case, then perhaps a macro or an app can help with that. You'd be able to enter the characters you want to count, and then the app or macro could run with them. I'd probably feed the characters into a Text to Columns tool, parse into rows on the delimiter(s) and then use a Summarize tool to count the records. The count minus 1 should give you the number of instances.