Convert an html table to excel spreadsheet

A quick and dirty post for a quick and dirty technique that I used to get the Oracle CPU Database Risk Matrix into a spreadsheet. This won’t always work (the html table I was interested in happened to have the data in the same line of html as the tag), but it’s a start.

– Do ‘View Source’ to get the html for the table. – Find the table – Cut and paste the table into a text file. I called mine “risk_matrix_raw.txt” – Create an awk file (mine was called risk_matrix.awk) with the following lines:

– awk the text file, then pipe into sed to remove some of the tags

– Open the .txt file in Excel. When I did this, Excel asks whether its a fixed width or a delimited file. I specified that the file was delimited with a ‘~’ and Excel opened it.