Hi, I'm trying to delete characters following a certain word (<-this word is "LON") using the Calculate Field tool in ArcGIS Pro. Anyone has any ideas how to do this? I'm looking for a script that I can put in the "Comments = " block of the Calculate Field tool.
I have a large dataset (n=389) and each line has different characters following the word "LON". So, the below script won't work. I'm looking for an alternative!
Replace($feature.<field_name>, "<text_value>", "")
Solved! Go to Solution.
Using python then:
!FieldNAME!.split("LON")[0] +"LON"
Just replace FieldNAME with the name of the field in question
Using python then:
!FieldNAME!.split("LON")[0] +"LON"
Just replace FieldNAME with the name of the field in question
This worked! Thank you so much!!
No probs. Could you mark it as the solution so others can quickly find it?
Can you give some samples of the data to better show the problem?
Sounds like you have something like
"LON 123" and you want to replace the "123" part?
Hi!
You can replace or delete any words or part of the word by any of the following options:
1.
2.