table describe ...

Prev Next

Function Names

table describe, table describe ignore case, table describe selected rows, table describe selected rows ignore case

Description

This function examins the contents in a specified column and places the description into another specified table column. The content examination follows two steps:

1. If 6 function parameters are provided (incl. 'name of lookup table', 'lookup pattern column', 'lookup description column'), then the lookup table will be consulted first. The strings in the target table are compared with the patterns where the equal operator = is used, supporting wildcard symbols. Such a table is suitable to pick up application specific information patterns such as phone numbers, e-mail addresses, decision answers (Yes, Now) and social security numbers. The lookup scheme allows to take over multiple columns, e.g. by providing a category and a sub-category of the value checked.

2 If only 3 function parameters are provided, or if the 1st step did not result in a match, then the contents will be checked for standard patterns as described in the function describe(). Resulting description may be 'blank', 'numeric', 'date', 'word', etc. In this case, only one column may be specified for the descriptions to put into the target table.

The specific function name table describe ignore case ignores cases in step 1 for the patterns. In this case, a pattern containing 'yes,no' will also match with values like 'YES' and 'No'.

Call as: procedure

Restrictions

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

Parameter count

3,6

Parameters

No.TypeDescription
1.
input
string target table name

The target table must exist.

Opt. 2.
code
expression
:string
Expression to select rows

Applicable to table describe selected rows and table describe selected rows ignore case:
Specify the conditions or rules to select the rows. See expressions to select rows.
The table context for partial table specifications is available for referencing just the columns easily. Example: [Year]>=2022.
Attention: Comparison operators = and <> (instead of == and !=) may hijack the next function parameters for its own use as additional comparison operands, e.g. a[]=1,3,5. As long this comparison is not made in the last function parameter, then put parentheses around them, e.g. ... , (a[]=1,3,5), ....

2. / 3.
input
table column Column with strings

See table columns as function parameters for general ruling for this parameter.
Specific rules apply for this function:

  • Only 1 header name or column number may be specified.

3. / 4.
input
table column Columns for descriptions

The descriptions related to the strings checked will be inserted into this column. Multipe columns can be specified, e.g. for a category and a sub-category to describe the string (e.g. weekday names, and language used for weekday names) See table columns as function parameters for general ruling for this parameter.
Specific rules apply for this function:

  • 1 header name or column number may be specified.
  • If 6 parameters are provided, then any number of, but at least 1, header names and column numbers may be specified
  • Missing headers will be created

Opt. 4./5.
input
string Name of lookup table

The existing lookup table will be used first to check the target columns for patterns in the lookup table in order to support application specific descriptions

Opt. 5./6.
input
table column Lookup pattern column

This column contains the lookup patterns. All wildcard symbols are supported here. Do not put the contents into single or double quotation marks unless they are seen as part of the patterns, e.g. actually checking for "example", a 9-character string.
See table columns as function parameters for general ruling for this parameter.
Specific rules apply for this function:

  • Only 1 header name or column number may be specified.

Opt. 6./7.
input
table column Lookup description columns

This column contains the corresponding descriptions. Example: Specify "U.S. social security number" if pattern is ###-##-####, a nine-digit number with two hyphens in fixed positions. Multipe columns can be specified, e.g. for a category and a sub-category to describe the string (e.g. weekday names, and language used for weekday names) See table columns as function parameters for general ruling for this parameter.
Specific rules apply for this function:

  • The same number of columns need to be specified as in the 3rd function parameter

Examples


       table initialize( target table,
        { Examples, This is a sentence, 123, 123.45, '+1 555 1212', yes, No, date(today), date(now), Tuesday, Dienstag, Hello, nick.nicelson@gmail.com, '(212) 555-1212' } );


       table initialize( lookup table,
       { { Check, Result, Language },
         { '+#*#,(###)*###*####', phone number },
         { '*@*.*', 'e-mail address' },
         { 'monday,tuesday,wednesday,thursday,friday,saturday,sunday', weekday, English },
         { 'montag,dienstag,mittwoch,donnerstag,freitag,samstag,sonntag', weekday, German },
         { 'no,yes', answer } } );

       table describe ignore case( target table, Examples, {Descr,Lang}, lookup table, Check, {Result,Language} );
       table list( target table );

Output

    0 : Examples                | Descr          | Lang   
    1 : This is a sentence      | line           |        
    2 : 123                     | integer        |        
    3 : 123.45                  | numeric        |        
    4 : +1 555 1212             | phone number   |        
    5 : yes                     | answer         |        
    6 : No                      | answer         |        
    7 : 2024-10-19              | date           |        
    8 : 2024-10-19 21:56:40     | date time      |        
    9 : Tuesday                 | weekday        | English
   10 : Dienstag                | weekday        | German
   11 : Hello                   | word           |        
   12 : nick.nicelson@gmail.com | e-mail address |        
   13 : (212) 555-1212          | phone number   |        

Try it yourself: Open LIB_Function_table_describe.b4p in B4P_Examples.zip. Decompress before use.

See also

describe
table lookup