table copy table selected rows, table split table selected rows
This function makes a copy of the table with selected rows only. The function table split table selected rows removes the transferred rows from the original table. If the new table is already existing, then it will be initialized.
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. input |
string | Name of new table |
3. code |
expression :string |
Expression to select rows to split Applicable to table split table selected rows only:
The selected rows will be moved into the new table. If the same row is also mentioned in the 4th parameter, then the row will be copied and not moved. |
Opt. 3. / 4. code |
expression :string |
Expression to select rows to copy The selected rows will be copied into the new table. Rows specified for both splitting and copying will be considered for copying. |
table initialize( t, {{ Name, Age }, { Ann, 45 }, { Dan, 35 }, { Eva, 40 }, { Nic, 10 } } );
echo("Original table:");
table list( t );
table copy table selected rows ( t, u, [Age]>=40 );
echo("Copied table:");
table list ( u );
table split table selected rows( t, v, [Age]>=40, [Name]=Eva );
echo("Source table after splitting: ");
table list (t );
echo("Destnation table after splitting: ");
table list (v );
Original table:
0 : Name | Age
1 : Ann | 45
2 : Dan | 35
3 : Eva | 40
4 : Nic | 10
Copied table:
0 : Name | Age
1 : Ann | 45
2 : Eva | 40
Source table after splitting:
0 : Name | Age
1 : Dan | 35
2 : Eva | 40
3 : Nic | 10
Destnation table after splitting:
0 : Name | Age
1 : Ann | 45
2 : Eva | 40
table copy table
table copy table columns
table split table columns