Hello Community!
First time posting.
Is it possible to extract characters after another character such as a hyphen? For example, I would like to extract STMH4120 from STMH4870-STMH4120 and place in a new field.
Thank you.
JD
sue, just use field calculator and python
Making simple field calculations—Help | ArcGIS Desktop
Calculate Field examples—Help | ArcGIS Desktop
!your_field_name!.split('-')[1]
That indicates that not all of your records follow that convention and it's choking on a value that does not. You might want to first make a selection where:
YourFieldName like "%-%"
That will get only those records that David's expression can calculate.
Hi David,
Python is enabled in Field Calculator, my new field is called DwnStrmMH and these new values will be based on splitting another fields value. I've entered !FacilityID!.split('-')[1] and an error message comes back (please see attached).
Thanks.
Thank you, Joe. That did it. And thank you David!
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.