Is it possible to slice a string in ArcMap's HTML-like dynamic text elements?
I've got a string field "Code" with contents like 'A.3.5', I need to extract the number in the middle ('3' in this case). Preferably, counting both from the string's start and backwards from string's end (because some codes were loaded without the first or the last '.' between the middle number and the adjacent char).
The dynamic text element's statement is
<dyn type="page" property="attribute" field="Code" domainlookup="true"/>. It's for a set of Data Driven Pages.
Python, VBScript or JScript solutions are welcome. I just don't know if they can be used within these text elements.
I'm asking specifically if this is possible, and how to do it if so. As a workaround, I've populated a new field in the SHP's dbf and used it in the text element.
Nevertheless, I'm being specific here because if it's possible to manipulate strings in these text elements I will need to do it many more times in the near future.
As good a workaround as the new field approach is, it's far from optimal. First, because I'm working with already field-dense shapefiles (many of them have around 200 fields, and more to be added over time). The example I provided is the simplest I could come up with, but there's a lot of to-be-extracted data crammed inside many other long string fields.
Furthermore, these shapefiles are destined for non GIS-savvy people who ideally ought to understand exactly what each field is. In time they should be populating / editing these fields by themselves, even create new fields. Which I'll have to teach them.
Adding unnecessary fields just as workarounds won't help in these cases. And eventualy it might lead to hitting a SHP's 255 fields limit.