table split table columns
This function moves selected columns from the existing to a new table..
The function table copy table columns selected rows copies only the selected rows instead of all rows.
If the new table is already existing, then it will be initialized.
Indirect parameter passing is disabled
3-4
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2. input |
string | Name of new table |
3. input |
table columns | Columns to spit See table columns as function parameters for general ruling for this parameter.
|
Opt 4. input |
table columns | Columns to copy See table columns as function parameters for general ruling for this parameter.
|
table initialize( t, {{ Name, Age, Hobby, Favorite Color },
{ Ann, 45, Skiing, Blue }, { Dan, 35, Skating, Orange },
{ Eva, 40, Bee keeping, Yellow }, { Nic, 10, Reading, Green } } );
echo("Original table:");
table list( t );
echo("Split out Hobby, copy Name and Favorite Color:");
table split table columns ( t, u, {Hobby, Favorite Color}, {Name, Favorite Color} );
table list( u );
echo("Original table contains Name and Age.");
table list( t );
Original table:
0 : Name | Age | Hobby | Favorite Color
1 : Ann | 45 | Skiing | Blue
2 : Dan | 35 | Skating | Orange
3 : Eva | 40 | Bee keeping | Yellow
4 : Nic | 10 | Reading | Green
Split out Hobby, copy Name and Favorite Color:
0 : Name | Favorite Color | Hobby
1 : Ann | Blue | Skiing
2 : Dan | Orange | Skating
3 : Eva | Yellow | Bee keeping
4 : Nic | Green | Reading
Original table contains Name and Age.
0 : Name | Age
1 : Ann | 45
2 : Dan | 35
3 : Eva | 40
4 : Nic | 10