How can I calculate a text value, the value of which is separated by a special character?
dog | duck, I would like to keep the first value:
elephant | cat, I want to keep
The length of characters are different.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Try using the
.split Python function in the field calculator. If, for example, you have
.split("|") function splits the string by
| into two parts
['dog', 'cat']. The
 at the end of the function states that you want the first of the two items in the list. Finally, to be sure there are no remaining spaces in the rows, use