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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jun 16, 2017 at 20:38
3
  • I would use ArcPy cursors to do this. Commented Jun 16, 2017 at 22:57
  • Thank you. I've never used ArcPy and have limited experience with python. How would this approach work? Commented 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. Commented 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.

Mattropolis
1,6842 gold badges15 silver badges33 bronze badges
answered Jun 18, 2017 at 1:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.