vande1

Using Wildcard to extract values with Field Calculator?

Discussion created by vande1 on Feb 7, 2013
Latest reply on Mar 13, 2013 by vande1
I'm trying to extract a portion of an existing field in an attribute table to a new field using Field Calculator and have been running into some difficulties. It seems like there must be a way to do this, although with my limited VBS and Python experience I can't be certain. I'm working with 10.0 (sp. 2)

The exact problem is this:

The layer I'm working with has a very long field, [PopUp] (which was created when converting a KMZ file to a feature class) whose contents for each feature look something like this:


...<td>LAND USE CODE</td> <td>954</td>...


I want to extract just the Land Use Code from the [PopUp] field and populate a new field with it (either a numeric field or string, I don't care).

The Land Use Code changes based on the feature in question and the length of the string varies for each feature both before and after this segment which I want to extract (so I can't use a function which just grabs X number of characters from the left or right side).

Is this possible using the Field Calculator, with either Python or VBScript?

If so, I assume it would require some way to indicate a wildcard on either side of the Land Use Code, but I know it doesn't work the same as a simple SQL query/search.

Any help would be greatly appreciated.

Thanks in advance!

Outcomes