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?
1 Answer 1
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.
Explore related questions
See similar questions with these tags.
SearchCursor
toprint
your data first, then move to using anUpdateCursor
and Python string manipulation to strip out the bits you need and write them to another field.