table copy columns, table copy columns selected rows
This function copies contents from selected columns to another set of selected columns. New columns will be created if the destination header
names are not yet existing. Otherwise, the existing columns will be overwritten.
table copy columns selected rows copies the contents only in rows meeting the conditional expression in the 2nd function parameter.
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 |
Opt. 2. code |
expression :string |
Expression to select rows Applicable to function table copy columns selected rows only. |
2 / 3 input |
table columns | Existing columns See table columns as function parameters for general ruling for this parameter.
|
3 / 4 input |
table columns | New columns See table columns as function parameters for general ruling for this parameter.
|
Type | Description |
---|---|
numeral | Number of columns copied |
Table not found
Header name not found
table initialize ( table,
{ { First Name, Last Name, Given Name, Birth Year },
{ Abel, Adams, A., 1990 },
{ Betty, Beavers, B., 1995 },
{ Charlie, Collins, C., 2000 },
{ Daniela, Douglas, D., 2005 } } );
table copy table ( table, example 1 );
echo("Copy 2 columns for 2 selected rows:");
table copy columns selected rows( example 1, [Birth Year]<1998, {First Name, Last Name}, { Given Name, Family Name } );
table list( example 1);
echo(new line, "Copy all columns into 5 new columns. The 1st column is copied into columns A and E (modulo rule).");
table copy columns ( table, '*', { A, B, C, D, E } );
table list( table );
Copy 2 columns for 2 selected rows:
0 : First Name | Last Name | Given Name | Birth Year | Family Name
1 : Abel | Adams | Abel | 1990 | Adams
2 : Betty | Beavers | Betty | 1995 | Beavers
3 : Charlie | Collins | C. | 2000 |
4 : Daniela | Douglas | D. | 2005 |
Copy all columns into 5 new columns. The 1st column is copied into columns A and E (modulo rule).
0 : First Name | Last Name | Given Name | Birth Year | A | B | C | D | E
1 : Abel | Adams | A. | 1990 | Abel | Adams | A. | 1990 | Abel
2 : Betty | Beavers | B. | 1995 | Betty | Beavers | B. | 1995 | Betty
3 : Charlie | Collins | C. | 2000 | Charlie | Collins | C. | 2000 | Charlie
4 : Daniela | Douglas | D. | 2005 | Daniela | Douglas | D. | 2005 | Daniela