table digest smart ...

Prev Next

Function Names

table digest smart, table digest smart ignore case

Description

This function combines the lookup strategy from table lookup smart() with the data integration features of table digest().

Call as: procedure or function

Restrictions

Indirect parameter passing is disabled

Parameter count

6 - 9 (For parameter description and return values: see table expand() )

Examples


  table load( lookup, "Examples/Table Lookup Example 2.csv" );
  table delete remaining rows ( lookup, -2 ); // Remove last 2 rows (the mom's place and 'not found' row)

  table initialize( target, { Seating, inside, balcony, outside, bar } );

  count[] = table digest smart ignore case
           ( target,   Seating, Place to go, lookup, Ambience, Restaurant Name, append with comma, true, Counter );

  echo("Lookup table:");
  table list( lookup );

  echo("Note: Nothing found for balcony.");
  echo("Target table after lookup (", count[], " items found):");
  table list( target );

Output

Lookup table:
    0 : Offering           | Table size | Ambience               | Restaurant Name       | Phone Number   | Counter
    1 : *Chicken*          | 2,4,6      | inside,bar             | Rôtisserie de Paris   | (212) 555-1234 | 2      
    2 : *Curry*            | 1..10      | "self-service"         | Bharat take-away      | (212) 555-2345 |        
    3 : *Pizza*,*Pasta*    | 4,6,8      | inside,outside         | Luigis                | (212) 555-3456 | 2      
    4 : *Beer*,*Wine*      | *          | bar                    | Luigis                | (212) 555-3456 | 1      
    5 : *Pizza*,*sea*food* | *          | inside,outside         | All-Italian Trattoria | (212) 555-4567 | 2      
    6 : *Fish*,*sea*food*  | 2..8       | outside                | Wharf Place           | (212) 555-5678 | 1      
    7 : *Burger*,Fries     | 1..20      | =inside,"self-service" | Mr. Burgermeister     | (212) 555-6789 | 1      

Note: Nothing found for balcony.
Target table after lookup (9 items found):
    0 : Seating | Place to go                                                       
    1 : inside  | Rôtisserie de Paris,Luigis,All-Italian Trattoria,Mr. Burgermeister
    2 : balcony |                                                                   
    3 : outside | Luigis,All-Italian Trattoria,Wharf Place                          
    4 : bar     | Rôtisserie de Paris,Luigis                                        

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

See also

table digest
table digest with rules
table lookup smart
table integrate smart
table expand smart