table rename headers, table rename column headers, table rename existing headers
This function renames specified table headers.
Whereas table rename column headers asserts exceptions if headers are not found, the table rename existing headers will simply ignore
the headers not found.
Note: Every table header will be renamed only once.
The function name table rename column headers is declared obsolete and will be replaced by the new name table rename headers in order to make
the naming more consistent.
Indirect parameter passing is disabled
3
No. | Type | Description |
---|---|---|
1 input |
string | Name of existing table |
2 input |
table columns | Existing header name(s) or column number(s) See table columns as function parameters for general ruling for this parameter.
|
3 input |
set or string | New header name(s) List the new header names corresponding to the existing ones specified in the previous function parameter. |
Type | Description |
---|---|
numeral | Number of renamings done |
Table not found
Header name not found
number of existing and new headers is inconsistent
table initialize ( table, { { First Name, Last Name, Phone No, Age }, { Archer, Jim, "1-212-555-1212", 28 } } );
count[] = table rename existing headers( table, { Last Name, First Name, Family Name }, {First Name, Last Name, Other Name} );
table list ( table );
echo;
echo("Number of headers renamed: ", count[]);
echo( new line, "This example demonstrates that each "First Name" column is touched only once.", new line );
table initialize ( table, { { First Name, First Name, Phone No, Age }, { Tanner, Lisa, "1-212-555-1212", 28 } } );
table rename headers( table, { First Name, First Name }, { Last Name, Given Name } );
table list ( table );
0 : Last Name | First Name | Phone No | Age
1 : Archer | Jim | 1-212-555-1212 | 28
Number of headers renamed: 2
This example demonstrates that each "First Name" column is touched only once.
0 : Last Name | Given Name | Phone No | Age
1 : Tanner | Lisa | 1-212-555-1212 | 28