table delete cells selected rows
This function extracts a column from the table and places the values in the parameter set from the selected rows where the calculated expression returns true. All blank or non-existing entries will be translated to blank strings. Automatic type conversion (e.g. numbers to numerals) can be adjusted with the table configure() function.
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
3-4
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2. code |
expression :string |
Expression to select rows Specify the conditions or rules to select the rows. See expressions to select rows. |
3. input |
table column | Existing column See table columns as function parameters for general ruling for this parameter.
|
Opt. 4. input |
string | Count Number of cells to delete (with contents to the right shifting to the left accordingly) |
Type | Description |
---|---|
numeral | Number of rows processed Counts all rows selected where cells have been deleted. |
table initialize ( t,
{ { Nr, A, B, C, D, E },
{ 1, A1, B1, C1, D1, E1, F1, G1 },
{ 2, A2, B2, C2, D2, E2, F2, G2 },
{ 3, A3, B3, C3, D3, E3 },
{ 4, A4, B4, C4, D4, E4, F4, G4 },
{ 5, A5, B5, C5, D5, E5, F5, G5 } } );
table copy table( t, u );
echo("2 cells removed in rows 2-4");
a[] = table delete cells selected rows( t, ([Nr]=2..4), C, 2 );
table list ( t );
echo("Number of rows affected: ", a[]);
echo("All remaining cells removed");
a[] = table delete cells selected rows( u, ([Nr]=2..4), C, -2 );
table list ( u );
echo("Number of rows affected: ", a[]);
2 cells removed in rows 2-4
0 : Nr | A | B | C | D | E | |
1 : 1 | A1 | B1 | C1 | D1 | E1 | F1 | G1
2 : 2 | A2 | B2 | E2 | F2 | G2 | |
3 : 3 | A3 | B3 | E3 | | | |
4 : 4 | A4 | B4 | E4 | F4 | G4 | |
5 : 5 | A5 | B5 | C5 | D5 | E5 | F5 | G5
Number of rows affected: 3
All remaining cells removed
0 : Nr | A | B | C | D | E | |
1 : 1 | A1 | B1 | C1 | D1 | E1 | F1 | G1
2 : 2 | A2 | B2 | G2 | | | |
3 : 3 | A3 | B3 | | | | |
4 : 4 | A4 | B4 | G4 | | | |
5 : 5 | A5 | B5 | C5 | D5 | E5 | F5 | G5
Number of rows affected: 3