Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > normalize a <table> with multiple, variable, data in each <td>

Reply
Thread Tools

normalize a <table> with multiple, variable, data in each <td>

 
 
okey
Guest
Posts: n/a
 
      07-14-2009
I have to believe this has been done many time before.

We have a well formed html <table> which contains X rows with Y
columns in each. Nice and regular...

Each <td> however contains mutliple chunks of data. Data in these
cells is delimited by a <br />
but could be anything I guess.

We need to take this table and regenerate it so that each data chunk
has it's own row.

For example

<table>
<tr>
<td>item01</td>
<td>item<br />item< br/>item</td>
</tr>

<tr>
<td>item03<br/></td>
<td>item<br /></td>
</tr>

would result in

<table>
<tr>
<td>item01</td>
<td>item</td>
</tr>
<tr>
<td>item01</td>
<td>item</td>
</tr>
<td>item01</td>
<td>item</td>
</tr>
<tr>
<td>item03 .....

.... and so on.

We could code this. but this has to be some kind of module (with
normal good module stuff). Is there something out there
 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      07-15-2009
In article
<fc1532dd-a45c-482d-b88a->,
okey <> wrote:

> I have to believe this has been done many time before.
>
> We have a well formed html <table> which contains X rows with Y
> columns in each. Nice and regular...
>
> Each <td> however contains mutliple chunks of data. Data in these
> cells is delimited by a <br />
> but could be anything I guess.
>
> We need to take this table and regenerate it so that each data chunk
> has it's own row.
>
> For example
>
> <table>

......
>
> ... and so on.
>
> We could code this. but this has to be some kind of module (with
> normal good module stuff). Is there something out there


There is the HTML::TableExtractor module, which will help you with
extracting the table info. Reformatting is then up to you. Breaking out
rows in an HTML table seems a little too specialized to have a module
already written, but who knows?

--
Jim Gibson
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vector, matrix, normalize, rotate. What package? =?iso-8859-1?B?TWF0dGlhcyBCcuRuZHN0cvZt?= Python 5 03-01-2007 05:57 PM
how to "normalize" indentation sources AndyL Python 6 05-25-2006 08:00 PM
How to normalize hundreds of mp3's Kyote Computer Information 5 04-20-2006 12:23 PM
XSLT to "normalize" weight attribute arnold XML 1 03-05-2006 05:27 PM
unicodedata . normalize (NFD - NFC) inconsistency Christos TZOTZIOY Georgiou Python 3 11-10-2004 08:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57