How may I extract HTML tables from a column in a shapefile?

03-15-2016 05:49 AM
Occasional Contributor

I have a shapefile which contains the elements needed for a small HTML table in one of the columns.  Each record has a table. 

An example of the resulting table is attached.  This is a sample record:

<br><br><br> <table border="1" padding="0"> <tr><td>SPANID</td><td>20</td></tr> <tr><td>PLACEMENT</td><td>underground</td></tr> <tr><td>OWNER</td><td>FIBERLIGHT</td></tr> <tr><td>DESIGNATED</td><td>Backbone</td></tr> <tr><td>STRANDS</td><td>36</td></tr>

Is there a good way to convert this column of data into a useful spatial or non-spatial table?  Or, should I parse it from what I already have?

0 Kudos
2 Replies
MVP Honored Contributor

I don't think you'll find an out-of-the-box tool to do this for you, so you'll need to parse it yourself. I'd suggest creating new fields in the current table rather than creating a new table for each row, but it may depend on your data.

Occasional Contributor III

I had to do something like this a real long time ago... I can give you sort of an outline of the steps I did my memory is not that good....

1.  Extract all the html table column to save it as text  (all records)  (I believe I had to add a unique Id to the column snippet to link upon later I used the field calculator to insert the additional column code <td>Unique ID</td>)

2.  I am assuming that the table snippets are valid complete table codes:  add <Html> [ all your table snippets] </HTML> to the file.

3.  Using excel import html table ... 

I got this idea from this web site: HTML TABLE TO EXCEL SPREADSHEET