table lift header row, table lift headers, table lift contents
This function is particularly useful for imported tables where the headers are not necessarily be located in the top row but somewhere else. To make things worse, the headers of the imported tables may be located in different rows. These functions described here will first search for existence of specified headers and then take following actions:
table search header row | Just return the row number where headers have been found. No manipulations done on the table. |
table lift header row | Delete all rows above the detected headers so the entire header row and all contents below move up to the top of the table. |
table lift headers | Move the headers to the 1st row. The original location of the headers become blank. Old contents in the 1st row will be overwritten. All other contents remain unchanged. |
table lift contents | Moves the headers as well as the affected columns underneath up. All other columns in the table remain unaffected. |
Indirect parameter passing is disabled
1-3 (min 2 required for 'table lift headers' and 'table lift contents')
No. | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1. input |
string | Name of existing table | ||||||||||||
Opt. 2 input |
table columns | Existing columns See table columns as function parameters for general ruling for this parameter.
Note:This 2nd function parameter is not required when using 'table lift header row' or 'table search header row'. In this case, following algorithm is applied to find the header row:
| ||||||||||||
Opt. 3 input |
string | Check header option With this option, you can make the search more restrictive, so wrong arrangements located further up in the table will not be detected first.
Checking option 1 affecting the table headers. Only one option can be chosen. See separate table on next page for more details.
|
Type | Description |
---|---|
numeral | Row number where header row has been found -1 is returned if no header row has been found |
table initialize( 2 tables,
{ { Created by, Nick, Miller, "", Last Update, "31.12.2019" },
{ Tennis, Players, "", "", Squash, Players },
{ Still a, "", "", "", Last Name, First Name, City },
{ Draft, "", "", "", Weber, Abel, 'Wilkes-Barre' },
{ First Name, Last Name, City, and, Tanner, Berta, San Monica },
{ Jane, Dominique, The Bronx, "", Miller, Dominique, Trenton },
{ Jasmine, Nelsson, Francfort, "", Quinn, Alex, Denver },
{ Dominique, Miller, Trenton, "", Jansen, Patricia, Albany } } );
echo("Original table:");
table list( 2 tables );
table copy table( 2 tables, table );
echo("Show 'table lift headers(..., must exist)':" );
echo("Note: It will recognize the headers in the right table.");
echo("Note: Contents below headers are not moved up.");
table lift headers( table, {First Name, Last Name, City} ); // 'must exist' is default
table list( table );
table copy table( 2 tables, table );
echo("Show 'table lift header row(..., must exist)':" );
echo("Note: It will recognize the headers in the right table. Entire rows below move up.");
table lift header row( table, {First Name, Last Name, City} ); // 'must exist' is default
table list( table );
table copy table( 2 tables, table );
echo("Show 'table lift header row(..., sequence)':" );
echo("Note: It will recognize the headers in the left table because they have same sequence.");
table lift header row( table, {First Name, Last Name, City}, sequence );
table list( table );
table copy table( 2 tables, table );
echo("Following code puts both tables with headers to 1st row" );
table lift contents( table, {First Name, Last Name, City}, sequence );
table lift contents( table, {Last Name, First Name, City}, sequence );
table list( table );
Original table:
0 : Created by | Nick | Miller | | Last Update | 31.12.2019 |
1 : Tennis | Players | | | Squash | Players |
2 : Still a | | | | Last Name | First Name | City
3 : Draft | | | | Weber | Abel | Wilkes-Barre
4 : First Name | Last Name | City | and | Tanner | Berta | San Monica
5 : Jane | Dominique | The Bronx | | Miller | Dominique | Trenton
6 : Jasmine | Nelsson | Francfort | | Quinn | Alex | Denver
7 : Dominique | Miller | Trenton | | Jansen | Patricia | Albany
Show 'table lift headers(..., must exist)':
Note: It will recognize the headers in the right table.
Note: Contents below headers are not moved up.
0 : Created by | Nick | Miller | | Last Name | First Name | City
1 : Tennis | Players | | | Squash | Players |
2 : Still a | | | | | |
3 : Draft | | | | Weber | Abel | Wilkes-Barre
4 : First Name | Last Name | City | and | Tanner | Berta | San Monica
5 : Jane | Dominique | The Bronx | | Miller | Dominique | Trenton
6 : Jasmine | Nelsson | Francfort | | Quinn | Alex | Denver
7 : Dominique | Miller | Trenton | | Jansen | Patricia | Albany
Show 'table lift header row(..., must exist)':
Note: It will recognize the headers in the right table. Entire rows below move up.
0 : Still a | | | | Last Name | First Name | City
1 : Draft | | | | Weber | Abel | Wilkes-Barre
2 : First Name | Last Name | City | and | Tanner | Berta | San Monica
3 : Jane | Dominique | The Bronx | | Miller | Dominique | Trenton
4 : Jasmine | Nelsson | Francfort | | Quinn | Alex | Denver
5 : Dominique | Miller | Trenton | | Jansen | Patricia | Albany
Show 'table lift header row(..., sequence)':
Note: It will recognize the headers in the left table because they have same sequence.
0 : First Name | Last Name | City | and | Tanner | Berta | San Monica
1 : Jane | Dominique | The Bronx | | Miller | Dominique | Trenton
2 : Jasmine | Nelsson | Francfort | | Quinn | Alex | Denver
3 : Dominique | Miller | Trenton | | Jansen | Patricia | Albany
Following code puts both tables with headers to 1st row
0 : First Name | Last Name | City | | Last Name | First Name | City
1 : Jane | Dominique | The Bronx | | Weber | Abel | Wilkes-Barre
2 : Jasmine | Nelsson | Francfort | | Tanner | Berta | San Monica
3 : Dominique | Miller | Trenton | | Miller | Dominique | Trenton
4 : | | | and | Quinn | Alex | Denver
5 : | | | | Jansen | Patricia | Albany
6 : | | | | | |
7 : | | | | | |