Next Previous Contents

4. Extracting information from tables

4.1 General

The following shows some examples of how the system is usually used, which involves a combinations of operators. Using the table named 'sample' the command:

      column NAME AMT TYP < sample | sorttable TYP | justify
    

gives the output:

                NAME     AMT  TYP
                ------  ----  ---
                Bush     133  A
                Hansen    23  A
                Perry    244  B
                Hart    1111  D
                Holmes  1111  D
                Jones     77  X
    

Note that the column COUNT was excluded by the 'column' operator, and that the order of the selected columns was changed from that in the input table. To save the output in a file (redirection of STDOUT into a file), use something like the following:

      column ... < sample | sorttable TYP | justify > file.out
    

An example using the operator 'row' on the table 'sample' is:

      row 'AMT < 900' < sample | column NAME AMT TYP |
            sorttable NAME | justify
    

Note how the row selection expression is surrounded by single quotes to prevent its interpretation by the shell. Here we select some rows using 'row,' select some columns using 'column,' sort what we have with 'sorttable,' and print with 'justify.' The output is:

                NAME    AMT  TYP
                ------  ---  ---
                Bush    133  A
                Hansen   23  A
                Jones    77  X
                Perry   244  B
    


Next Previous Contents