2

I am working with a file geodatabase (.gdb) where one of the attribute columns contains html code:

Screenshot of Attribute Table in ArcGIS

My issue is that the attributes that I need are embedded in the html code. The screenshot below shows a "Prj_type" field with a value of "Sediment Diversion" for the highlighted feature. I need a "Prj_Type" column that would have a value of "Sediment Diversion" for this feature:

Screenshot of Attribute Table after Exported to Excel

(The attribute table viewer in ArcGIS only shows the first line, so I exported the table to Excel to see the full html code.)

Is there a way to parse the html in this attribute column to create new columns based of the fields and values in the html?

3
  • I would use ArcPy cursors to do this.
    – PolyGeo
    Jun 16, 2017 at 22:57
  • Thank you. I've never used ArcPy and have limited experience with python. How would this approach work?
    – Ezra Boyd
    Jun 16, 2017 at 23:07
  • See if you can use a SearchCursor to print your data first, then move to using an UpdateCursor and Python string manipulation to strip out the bits you need and write them to another field.
    – PolyGeo
    Jun 16, 2017 at 23:38

1 Answer 1

2

If you're not comfortable in Python but love Excel, you could export out that field and an id field you could join with later. Then in Excel, find/replace, Mid, Left, Right functions to rip it apart and place it in new correct fields, then join back to your featureclass and drop the html field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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