Search within Tables

The table() function finds documents containing arguments within tables or table sections that match specified criteria.

Syntax

table([term_1, [term_2, …​]])

The function supports optional named parameters that specify additional search criteria. A list of these parameters is given below:

Parameter

Comments

name

Search within tables with a specified name; may be specified by a PDL-query.

number

Search within tables with a specified number.

col/column

Search within columns with a specified name/number; may be specified by PDL-query.

row

Search within rows with a specified name/number; may be specified by a PDL-query.

cell

Search within specified cells; may be specified by a PDL-query.

match

Specifies table sections that should be highlighted (cell/row/column).

whole:=yes/no

whole:=yes is used to find a text only if it matches the whole cell value, column, row or table name (set to no by default).

level

Specifies a nested table level (starting from 1) using operators ">", "<", ">=", "<=", "!=".

nested:=yes/no

Search within or outside of nested tables (default value is "no")

has_nested:=yes/no

Search only tables containing nested tables (default value is "yes").

Note

One can use the relational operators ">", "<", ">=", "<=", "!=" to specify a search within numerical parameters, e.g. table(col:>1, col:<3, row:>4)

Example

table() matches all tables of the document.

table(density, velocity) matches all occurrences of the words density and velocity within tables.

table(density, velocity, match:=cell) matches table cells containing words density and velocity.

table(density, velocity, match:=row) matches table rows containing words density and velocity.

table(name:=phrase(glucose, tolerance or level)) matches tables with the name matched by the query, such as "Oral glucose tolerance test", "Normal and Diabetic Plasma Glucose Levels in mg/dL", etc.

table(col:="atomic number", row:=lithium or carbon) matches table cells at the intersection of column and row with name matched by the query.

table(number:=3) matches the table 3.

table(number:=4, column:=2) matches the column 2 of the table 4.

table(col:=orn(underweight, weight, overweight)) matches columns with the name matched by the query, such as "Healthy weight", "Overweight 25 to 29.9", "Underweight Below 18.5", "Low birth weight", etc.

table(number:=4, row:=23, column:=2) matches cell at the intersection of the column 2 and the row 23 of the table 4.

table("customer", has_nested:=yes) matches the word "customer" if it occurs in a table containing nested tables.

table(row:>=5, level:=2, "glucose intolerance") matches all rows starting with 5 and containing "glucose intolerance" within a second-level nested table.

table(cell:="glucose intolerance", nested:=yes) matches all cells containing "glucose intolerance" within a nested table.

Task example: Find frequency of administration of Naltrexone and Acamprosate

Users can write the following expression to complete this task: table(row:=Frequency of Administration, column:=Naltrexone or Acamprosate, match:=cell). The cell at the intersection of the rows containing the words "Naltrexone" or "Acamprosate" and of the column containing the phrase "Frequency of Administration" will be matched.

pdl table 1