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

Discussion in 'Perl Misc' started by okey, Jul 15, 2009.

  1. okey

    okey Guest

    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
    okey, Jul 15, 2009
    #1
    1. Advertising

  2. okey

    Jim Gibson Guest

    In article
    <>,
    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
    Jim Gibson, Jul 15, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arnold
    Replies:
    1
    Views:
    589
    arnold
    Mar 5, 2006
  2. Christos TZOTZIOY Georgiou

    unicodedata . normalize (NFD - NFC) inconsistency

    Christos TZOTZIOY Georgiou, Nov 8, 2004, in forum: Python
    Replies:
    3
    Views:
    872
    Christos TZOTZIOY Georgiou
    Nov 10, 2004
  3. AndyL
    Replies:
    6
    Views:
    414
    John Machin
    May 25, 2006
  4. =?iso-8859-1?B?TWF0dGlhcyBCcuRuZHN0cvZt?=

    Vector, matrix, normalize, rotate. What package?

    =?iso-8859-1?B?TWF0dGlhcyBCcuRuZHN0cvZt?=, Feb 27, 2007, in forum: Python
    Replies:
    5
    Views:
    6,286
  5. Mike
    Replies:
    0
    Views:
    393
Loading...

Share This Page