Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to split a string field after the first word using the space as a delimiter so that "WA ROSSOUW ORANJE BELEGGINGS" becomes "ROSSOUW ORANJE BELEGGINGS".

I am using Arcmap10.

Thanks.

share|improve this question
    
This worked for me. THANKS! Incidentally, if I just wanted to extract ONLY the first word, how would you suggest I modify the VBA code? –  Phil Apr 29 at 17:25

3 Answers 3

Or the two-liner using Python:

(in Show Codeblock)

    import string

in Class = :

string.join(!YourFieldName!.lstrip().split(' ')[1:],' ')

The lstrip() makes sure there are no leading spaces which will cause problems

share|improve this answer
2  
Python string module functions are deprecated (docs.python.org/library/string.html). String object methods are preferred, e.g. ' '.join(!YourFieldName!.lstrip().split(' ')[1:]) –  Luke Apr 3 '12 at 3:28
    
shorter too, so can't argue with that. –  Stev_k Apr 3 '12 at 8:32

You can simply use the following VBA code in field calculator :

Split( [Your_Field_Name] , " ", 2)(1)
share|improve this answer
    
Thanks, but I am getting a "failure during processing" message when I use it. –  Annie Mar 30 '12 at 11:50

you can use python if you want.

text = "WA ROSSOUW ORANJE BELEGGINGS"
sptext = text.split(" ") 
result = ' '.join(sptext[1:len(sptext)])
print result

>>>"ROSSOUW ORANJE BELEGGINGS"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.