in reply to How to catch table format display from actual html using TableExtract?

I'm not sure if I understand the nature of your problem. You say:

i am getting the expected result. But problem is that , i couldn't maintain the structure. I would like to display the table as format as in the html (selected column).

Do you mean that you are not getting just the three particular columns you want in your output ('Account, Detail, Amount')? If that's the case, then maybe the first row of the HTML table should be using  <th> tags instead of  <td> tags -- I'm guessing that HTML::TableExtract may be relying on the markup to be that way, so it knows where to find the "header" labels in the html table structure.

If that's not the issue, then you'll need to explain your problem more carefully. Just what sort of output are you getting, and how does it differ from your intention, exactly?

Replies are listed 'Best First'.
Re: Re: How to catch table format display from actual html using TableExtract?
by Anonymous Monk on Jul 10, 2003 at 12:01 UTC
    Hi
    Thanks for your reply.
    I would like get the final output as ...
    <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="84" bgcolor="#000000"><font face="Arial Narrow" color=" +#FFFFFF"><strong>Account </strong></font></td> <td width="119" bgcolor="#000000"><font face="Arial Narrow" color= +"#FFFFFF"><strong>Detail</strong></font></td> <td width="86" bgcolor="#000000"><font face="Arial Narrow" color=" +#FFFFFF"><strong>Amount</strong></font></td> </tr> <tr> <td width="84" bgcolor="#C0C0C0"><small><font face="Arial Narrow" +>162456</font></small> </td> <td width="119" bgcolor="#C0C0C0"><font face="Arial Narrow"><smal +l>UNITED STATES 3217150214</small> </font></td> <td width="86" bgcolor="#C0C0C0"><small><font face="Arial Narrow" +>$1.00</font></small> </td> </tr> <tr> <td width="84" ><small><font face="Arial Narrow">162456</font></sm +all> </td> <td width="119" ><font face="Arial Narrow"><small>UNITED STATES 52 +17733259</small> </font></td> <td width="86" ><small><font face="Arial Narrow">$0.30</font></sma +ll> </td> </tr> <tr> <td width="84" bgcolor="#C0C0C0"><small><font face="Arial Narrow" +>162456</font></small> </td> <td width="119" bgcolor="#C0C0C0"><font face="Arial Narrow"><smal +l>UNITED STATES 4633895267</small> </font></td> <td width="86" bgcolor="#C0C0C0"><small><font face="Arial Narrow" +>$0.30</font></small> </td> </tr> <tr> <td width="84" ><small><font face="Arial Narrow">162456</font></sm +all> </td> <td width="119" ><font face="Arial Narrow"><small>UNITED STATES 60 +958767236</small> </font></td> <td width="86" ><small><font face="Arial Narrow">$0.10</font></sma +ll> </td> </tr> </table>
    Thanks
      I would like get the final output as ...

      Okay... so, uhm... what's stopping you from getting that, exactly? What are you getting instead? If you are getting what you want from the TableExtract module, the rest is just a matter of printing stuff out.

      You might want to look into something like HTML::Template, to have the page/table layout and all those font attributes in a separate html text file (not embedded in your perl code), and the perl script would just populate that template with the actual data values. (Or, if this is just a one-shot deal, just set up a nested loop: outer loop prints the table rows, inner loop prints the cells on each row. That way, at least you only have to state all those attributes once.)