htmltabletoarray
htmltabletoarray
TABLE
,
ARRAY
,
ROWSEP
,
COLSEP
,
COLSEP

The htmltabletoarray statement converts an HTML table into a text array.

Parameters

This statement has five parameters:

table – text that contains the body of an HTML table. It should not contain the `<table>` and `</table>` tags.

array – field or variable that the output will be placed into.

rowsep – output row separator (will be carriage return if omitted).

colsep – output column separator (will be tab if omitted).

colsep – a comma-delimited list of the table columns to be included. For example `"2,5,6,10"` would import four out of 10 (or more) columns. If this parameter is missing then all columns will be included. If this parameter beginswith “+” or “+,” then each column will be preceded by the column number in parentheses, but it will be very slow.

Description

This statement converts an HTML table into a text array. Here is a simple example:

    local htable,results
    htable = "<tr><td>Mary</td><td>Gold</td></tr>"+cr()+
        "<tr><td>Lucy</td><td>Silver</td></tr>"+cr()+
        "<tr><td>Ann</td><td>Bronze</td></tr>"
    htmltabletoarray htable,results,cr()," : "
    message results

For clarity, this example builds the HTML table right in the program, but you would usually extract it from a larger HTML page. The result of this example will be:

    Mary : Gold
    Lucy : Silver
    Ann : Bronze

See Also

- HTML Export -- custom exports into an HTML file.
- htmlarraytable -- generates an HTML table from an arrray.
- htmldatamerge -- uses a template to generate HTML you want from a database.
- htmldatatable -- generates an HTML table from selected data in the current database.
- htmlextractimages -- extracts the image URLs from an HTML page.
- htmlextractlinks -- extracts the links from an HTML page.
- htmlformitemnames -- returns a list of form input elements (*INPUT* tags, etc.) within an HTML page.
- htmltablecell( -- extracts the data from a cell in an HTML table.
- htmltablecellexists( -- returns true if an HTML table contains the specified cell, false if it doesn't.
- htmltablecellraw( -- extracts the data from a cell in an HTML table (including tags, if any).
- htmltableheight( -- calculates the height (number of rows) in an HTML table.
- htmltablerow( -- extracts the data from a row in an HTML table.
- htmltablerowraw( -- extracts the raw data (including tags, if any) from a row in an HTML table.
- htmltablewidth( -- calculates the width (number of columns) in an HTML table.
- xtag( -- generates an HTML/XML tag.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but the ROWSEP and COLSEP parameters are now optional.