How To: Extract characters from a string field to a new field using a space as a delimiter
Instructions provided describe how to extract characters from a string field to a new field using a space as a delimiter. This article contains a code sample that extracts all characters to the left of the first space and pastes them into another field.
Follow the steps below:
Click Editor on the Editor Toolbar and click Start Editing.
Right-click the layer or standalone table in the Table of Contents and click either 'Open Attribute Table' or 'Open' table.
Right-click the field heading for the field in which the extracted characters are stored. Click Calculate Values.
Click on the Advanced checkbox.
Type the following VBA statement in the first text box:
Code: dim space as integer space = instr([name], " ") dim var as string var = left([name], space)
Change [name] in lines 2 and 4 to the source field name.
Type the variable 'var' in the text box directly under the area field name.