Converting HTML data into a spreadsheet

Hi,

I have a perl script that prints some data in the form of a table (HTML table) Now, I want to be able to convert this data into a report on an Excel sheet. How can I do this?

Regards,
Garric

Modding the script is probably less frustrating than parsing HTML tables.

Tab-delimited or comma-delimited should be fine for any spreadsheet.

(I wouldn't be surprised if Excel and/or OOo had limited support for directly importing HTML tables these days, either.)

Thanks, a comma seperated list wont be a problem. Any idea how I can add the 'file creation box' (the one that pops up when we try creating a new file on wondows) on the html web page? Can you help?

if you are planning to create a fancy excel sheet, then Spreadsheet::WriteExcel will help you

awk 'BEGIN{
FS="|"
print "<HTML><BODY><TABLE border=1>"
}
{

    printf "&lt;TR&gt;"
    if\(i=1\)
   printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"100\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;&lt;b&gt;%s&lt;/font&gt;&lt;/b&gt;&lt;/TD&gt;", $i
    if\(i=2\)
    printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"300\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;%s&lt;/font&gt;&lt;/TD&gt;", $i
    if\(i=3\)
    printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;%s&lt;/font&gt;&lt;/TD&gt;", $i
    if\(i=4\)
    printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;%s&lt;/font&gt;&lt;/TD&gt;", $i
    if\(i=5\)
    printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;%s&lt;/font&gt;&lt;/TD&gt;", $i
    if\(i=6\)
    printf "&lt;TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"&gt;&lt;font size=\\"2\\" face=\\"Verdana\\"&gt;%s&lt;/font&gt;&lt;/TD&gt;", $i
 \}
 END\{
    print "&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;"
 \}
 ' file.txt &gt;&gt; file1.xls

****** i-- has number of records
******delimiter is " |"

it's return XLS files and open in windows.