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
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 "<TR>"
if\(i=1\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"100\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\"><b>%s</font></b></TD>", $i
if\(i=2\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"300\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\">%s</font></TD>", $i
if\(i=3\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\">%s</font></TD>", $i
if\(i=4\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\">%s</font></TD>", $i
if\(i=5\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\">%s</font></TD>", $i
if\(i=6\)
printf "<TD ALIGN=\\"LEFT\\" width=\\"80\\" height=\\"25\\"><font size=\\"2\\" face=\\"Verdana\\">%s</font></TD>", $i
\}
END\{
print "</TABLE></BODY></HTML>"
\}
' file.txt >> file1.xls
****** i-- has number of records
******delimiter is " |"
it's return XLS files and open in windows.