using AWK I am trying to fill down a HTML table (rows/columns) based on the previous value. Similar to excel.
eg:
table
user$ csv2html.awk table.csv
rowing | fast | good
| fast | good
swim | |
| | slow
| | increase
| late |
golf | red | bad
I want this html table to then become the following:
table
rowing | fast | good
rowing | fast | good
swim | fast | good
swim | fast | slow
swim | fast | increase
swim | late | increase
golf | red | bad
The table can have any number of columns/rows and the values can vary across many different words. I am simply trying to understand how to parse the html and then fill down the value that I find in each column/row.
Output must be to a new html file that keeps formatting.
UPDATE:
<html><body><table>
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</tr>
<tr>
<td>rowing</td>
<td>fast</td>
<td>good</td>
</tr>
<tr>
<td></td>
<td>fast</td>
<td>good</td>
</tr>
<tr>
<td>swim</td>
<td></td>
<td></td>
</tr>
</table></body></html>