URL: http://www.firstbasesoftware.com/man/man1/dbfilter.htm
Last modified: 3 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]


NAME

dbfilter - filter an existing FirstBase index into a new FirstBase index

SYNOPSIS

dbfilter [-b] [-y] [-s] [-a] [-d database] [-i index] [-c columns] [-f filter_index] [filter_file | - ]

DESCRIPTION

Dbfilter generates a distinct new index using an existing index and a filter_file. Each line of the filter_file, a standard text file, is looked up in the index. If the referenced index entry exists, it is written to the new filter_index. In other words, the filter_file is used to filter index into filter_index.

The result, filter_index, is a complete FirstBase index. (Note: since dbigen(1) is not used to generate filter_index, no *.idicti file is used). Error messages are generated for each filter_file request that cannot be referenced. Using -a finds all occurrences of each filter line, and -s sorts filter_index after completion.

The -c switch allows setting the number of character columns or positions that will be used to generate the index search key. Normally, the width of the index indicates the number of character columns required to match during the index lookup. The filter_file can be wider than this -- only the first columns are used to reference the indexed record. The columns can also be set to less than the width of the index.

The -b flag will run the FirstBase tool in batch mode, suitable for shell scripts. This mode produces no output on the terminal, thus can also be used when running the process in the background. The -y flag will run the tool at the terminal without pausing to ask the user if existing files can be destroyed.

If the filter_file specified is -, standard input (the keyboard) is read, and batch mode (-b) is set. This works also when batch mode is set, but no filter_file is specified. For example the following is valid:

grep pattern text_file | dbfilter -d dbase -i index -f new -c 10 -b

Another interesting use of dbfilter can be achieved by generating an index (dbigen(1)) and using dbawk(1), dbemit(1) or dbmerge(1) to generate a filter_file. This filter_file can then be edited or filtered using other Unix tools (sed(1), awk(1), etc). The filter_file is then used to generate a new FirstBase index, usable with existing tools and scripts. Remember to make the first part of the filter_file look like the first part of the indexed field.

Dbfilter(1) provides a convenient method of filtering an existing FirstBase index into a new index that can then be used anywhere in the FirstBase system.

FILES

dbase
default name of database.

*.cdb
FirstBase database.

*.map
record map of FirstBase database.

*.ddict
FirstBase database dictionary file.

FILTER
default filter_file.

filter
default filter_index.

SEE ALSO

dbdind(1), dbigen(1), dbawk(1), dbemit(1)

FirstBase User's Guide and Reference Manual

DIAGNOSTICS

Dbfilter(1) will ask permission before overwriting an existing FirstBase index when not run in batch mode.


URL: http://www.firstbasesoftware.com/man/man1/dbfilter.htm
Last modified: 3 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]