Just messing arround in linux and dabaling into AWK. How would I go about changing a CSV formatted file into a HTML formatted one. For example... here is the information I have loaded into my shell...
user$ cat table.csv
Ep#,Featured Film,Air date
211,First Spaceship on Venus,12/29/90
310,Fugitive Alien,08/17/91
424,Manos: The Hands of Fate,01/30/93
Then after running the code this is what should be outputted.
user$ csv2html.awk table.csv
<html><body><table>
<tr>
<th>Ep#</th>
<th>Featured Film</th>
<th>Air date</th>
</tr>
<tr>
<td>211</td>
<td>First Spaceship on Venus</td>
<td>12/29/90</td>
</tr>
<tr>
<td>310</td>
<td>Fugitive Alien</td>
<td>08/17/91</td>
</tr>
<tr>
<td>424</td>
<td>Manos: The Hands of Fate</td>
<td>01/30/93</td>
</tr>
</table></body></html>
I have tried some things along the line of this but I am having some complie errors...
#!/bin/awk
print "<tr>
for( i = 1; i <= NF; i++)
print "<td> "$i" </td"
#print "</tr>"