2

How do I populate a field in ArcMap (and Excel) with only a specific part of another field's attributes? For example: I want to populate the LATDEG field with only the degree part of a latitudinal co-ordinate and not the entire value.

2

you can return the floored value.

In ArcGIS (with Python parser in the field calculator)

int(floor(!yourfield!))

if you have a text field:

!yourfield!.split(".")[0] # split at the dot and take the first(=left) part

(in Excel: FLOOR ( number , 0) )

  • With Python, it is also possible to get the first or last X characters, and to split by any character (space or " or something else) and return what is before, after or inbetween that character. – Martin Aug 20 '14 at 10:27
  • Thanks Martin, I've updated my post for text field. Note that the number of character is unknown (1, 2 or 3 digits for longitude in degree), so taking the X first would not work. – radouxju Aug 20 '14 at 10:38
  • Thank you very much. I have a query which I should have asked before this: I am trying to export an excel table to a dbf in ArcMap but it returns an error each time I try; what am I doing wrong? – GIS_Girl Aug 20 '14 at 11:37
  • please post this comment as a question, with details about the error message and what you've tried so far. someone might have the answer. – radouxju Aug 20 '14 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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