>> GIS Education
Thread views: 16875 View all threadsNext thread*Threaded Mode

(Stranger )
05/15/07 11:34 AM
String Function ArcMap9.2 new Report this article as Inappropriate to us !!!Login to Reply

I have a shapefile with over 1000 features with three fields, x,y and one field has numbers and letters designating points e.g.
What I want to do is create another field that will keep the numbers and get rid of the letters. The reason for this is there is a database file I want to link this to that does not have x,y data. Any suggestions? Thanks in advance.

(Stranger )
05/17/07 07:00 AM
Re: String Function ArcMap9.2 [re: Diomedes]Report this article as Inappropriate to us !!!Login to Reply

VBA string functions are pretty easy to use in ArcGIS, but they are very difficult to find in the ArcGIS help. Create a string variable in your attribute table (open the attribute table in your Map, click Options, select Add a Field and give the field a name (less than 8 characters), a data type (string) and a length (3) and click OK (the window closes and the field is created). Now RIGHT click on the new field and select Field Calculator. This will do an on-the-fly computation and put the results into this new field. In the VBA builder windows you can select MID (upper right frame) and it will be added to the lower frame. (Check that the new variable name is in the grey area just above the lower frame followed by an equals sign. This is the variable you will be calculating; you don't want to accidentally overwrite an existing attribute variable.) Now select the old variable name from the upper left frame (this puts the old variable into the parenthesis following the MID command. Now insert ,1,3 between the old variable and the closing parenthesis (to indicate you start at position 1 and take 3 characters) to get something like:
When you click OK, the new field should be filled by the computed value of the first 3 characters of the old variable.
Good luck. - Lilli

View all threadsNext thread*Threaded Mode
Jump to


Teledyne Optech
Teledyne: - Countless CAD add-ons, plug-ins and more.

Internet Business Systems © 2017 Internet Business Systems, Inc.
595 Millich Dr., Suite 216, Campbell, CA 95008
+1 (408)-337-6870 — Contact Us, or visit our other sites:
AECCafe - Architectural Design and Engineering EDACafe - Electronic Design Automation TechJobsCafe - Technical Jobs and Resumes  MCADCafe - Mechanical Design and Engineering ShareCG - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy Policy