table find cells, table find cells seleted rows, table find cells in columns, table find cells selected rows in columns
This function looks for cells using the right-hand comparison expression across all or selected columns and across all or selected rows. The return value will contain a set containing all coordinates in a 2-level set: { { row number, column number }, ... } .
Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name and row number for selected function parameters
2-5
No. | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1. input |
string | target table name The target table must exist. | |||||||||||||||||||||||||||
Opt. 2. code |
expression :string |
Expression to select rows Applicable to table find cells selected rows and table find cells selected rows in columns: | |||||||||||||||||||||||||||
Opt 2. / 3. input |
table columns | Header names and/or column numbers See table columns as function parameters for general ruling for this parameter.
| |||||||||||||||||||||||||||
2 / 3 / 4 input |
string set |
values to compare Provide one string or multiple strings in a set to compare with the table contents. wildcards are supported if the strings are of type softquoted string. | |||||||||||||||||||||||||||
Opt. 3 / 4 / 5 input |
string set |
options One or multiple options may be applied.
Notes: |
Type | Description |
---|---|
set | Table coordinates (row, column) identified A 2-level nested set containing rows and columns will be returned, e.g. { { row 1, column 1 }, { row 2, column 2 }, ... }. Empty set is returned in case of no matches. |
table initialize( t,
{ { City, State, Country },
{ Tuscon, AZ, United States },
{ Toronto, ON, Canada },
{ Missisauga, ON, Canada },
{ Zürich, ZH, Switzerland },
{ Lake Zurich, MI, United States } } );
table list(t);
c[] = table find cells( t, {} );
echo ("Nothing to look for: ", c[]);
c[] = table find cells( t, { canada, 'swit*' }, ignore case );
echo ("All countries except USA: ", c[]);
c[] = table find cells in columns( t, City, '*Z*rich*' );
echo ("All Cities somewhat sounding 'swiss', point on countries: ",c[]);
c[] = table find cells selected rows in columns( t, [Country]==Canada, State, ON, {once,left} );
echo ("1st Ontario match, point on city: ", c[]);
echo ("City is ", [t:c[]{0}{1},c[]{0}{0}] );
c[] = table find cells( t, Tuscon, left);
echo ("Empty set, as attempting to return coordinates beyond left side of table: ", c[]);
0 : City | State | Country
1 : Tuscon | AZ | United States
2 : Toronto | ON | Canada
3 : Missisauga | ON | Canada
4 : Zürich | ZH | Switzerland
5 : Lake Zurich | MI | United States
Nothing to look for: {}
All countries except USA: {{2,2},{3,2},{4,2}}
All Cities somewhat sounding 'swiss', point on countries: {{4,0},{5,0}}
1st Ontario match, point on city: {{2,0}}
City is Toronto
Empty set, as attempting to return coordinates beyond left side of table: {}