table delete blank rows
This function deletes all blank rows from all listed tables, or reduces the number of consecutive blank rows to a specified number.
Indirect parameter passing is disabled
1 - 4
No. | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1. input |
string | Name of existing table | ||||||||||||||||||
Opt. 2. input |
numeral | Number of consecutive rows to keep If 1 (or 2, 3, ...) is specifed, then number of consecutive blank rows will be reduced to (or 2, 3, ...). Default value: 0 | ||||||||||||||||||
Opt. 3. input |
string | Blank criterion One of following:
Default value: blank fields | ||||||||||||||||||
Opt 4 input |
table columns | Columns to check Specify the columns which shall be checked if they are blank and ignore the contents in the remaining columns.
|
Type | Description |
---|---|
numeral | Number of rows deleted |
table initialize( t,
{ { Last Name, First Name, Favorite Sports },
{ Adams, Andy, American Football },
{ " ", "", Baseball },
{ },
{ "" },
{ " " },
{ Mayer, Mick, Tennis },
{ Tanner, Tina, Wrestling } } );
echo ("Original table:");
table list(t);
echo ("Demonstrate deleting all rows:");
table copy table ( t, u );
table delete blank rows ( u );
table list ( u );
echo (new line, "Demonstrate deleting all rows without names");
table copy table ( t, u );
table delete blank rows ( u, 0, blank fields, {First Name, Last Name} );
table list ( u );
echo (new line, "Demonstrate deleting empty rows (0 columns) -> only 1 row removed");
table copy table ( t, u );
table delete blank rows ( u, 0, entirely empty row );
table list ( u );
echo (new line, "Reduce # blank rows to 1:");
table copy table ( t, u );
table delete blank rows ( u, 1 );
table list ( u );
Original table:
0 : Last Name | First Name | Favorite Sports
1 : Adams | Andy | American Football
2 : | | Baseball
3 : | |
4 : | |
5 : | |
6 : Mayer | Mick | Tennis
7 : Tanner | Tina | Wrestling
Demonstrate deleting all rows:
0 : Last Name | First Name | Favorite Sports
1 : Adams | Andy | American Football
2 : | | Baseball
3 : Mayer | Mick | Tennis
4 : Tanner | Tina | Wrestling
Demonstrate deleting all rows without names
0 : Last Name | First Name | Favorite Sports
1 : Adams | Andy | American Football
2 : Mayer | Mick | Tennis
3 : Tanner | Tina | Wrestling
Demonstrate deleting empty rows (0 columns) -> only 1 row removed
0 : Last Name | First Name | Favorite Sports
1 : Adams | Andy | American Football
2 : | | Baseball
3 : | |
4 : | |
5 : Mayer | Mick | Tennis
6 : Tanner | Tina | Wrestling
Reduce # blank rows to 1:
0 : Last Name | First Name | Favorite Sports
1 : Adams | Andy | American Football
2 : | | Baseball
3 : | |
4 : Mayer | Mick | Tennis
5 : Tanner | Tina | Wrestling