I have a field contains owners name
Doe, John and Jane
I am trying to remove everything so just the last name showsDoe
I have tried several codes but nothing is working so far. I have Desktop 10.4
Could anyone give me some help please?
python parser in the field calculator, no need for a codeblock if it is a text field
!YourFieldName!<SPAN class="punctuation token">.</SPAN>split<SPAN class="punctuation token">(</SPAN><SPAN class="string token">","</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Guessing you are using the field calculator, add a little Pre-Logic code:
def justname(txt): return txt[0: txt.find(',')]
Thank you! It worked
Thank you! I really appreciated the help.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.