FILO(1)

NAME
filo - look up entries in a Rolodex-like file.

SYNOPSIS
filo [-iekbdtpO] [-o output-file] [-f filodex] [-r return] [-s stamp] [-h header] [-ETRSBP x,y] [@setting] [regular_expression]

DESCRIPTION
filo reads a data file and picks out those entries that contain a match to the supplied regular expression. If no expression is supplied, all entries in the filodex are matched. Optionally, filo writes PostScript instructions to the standard output (or to output_file if the -o option is specified) to create one or more addressed envelope(s), or to produce an alphabetical directory. Directory information may also be formatted in plain ASCII or TeX typesetting source.

DATAFILE FORMAT

All files are searched for in the path given by the environment variable FILOPATH, or, if FILOPATH is undefined, in the directory $HOME/.filo if it exists. If $HOME/.filo does not exist, files are searched for in the current directory. The default data file is "filodex", and has entries separated by blank lines (two consecutive carriage returns). The entries may be an arbitrary number of lines long. If the environment variable FILODEX is set, its value is used for the database filename, overriding "filodex". Entries whose first character is a percent sign (%) are not searched. Other lines in an entry may begin with a percent sign (%) but these lines will not be written on envelopes. (The percent character was chosen so that TeX can also read the filodex and allows TeX macros to be embedded in the database.) Lines beginning with a pound sign (#) are also comments, but an entry which begins with a pound-sign comment line will still be searched for matches to regular_expression. Neither pound-sign comment lines nor percent-sign comment lines are written on envelopes. Within a comment line, several special fields are recognized. The keywords tel , fax , and email are scanned for further information about the entry. When making a directory, these fields can be printed. The field must have the form keyword = value or keyword: value to be recognized by filo. Additionally, an e-mail address of the form <address> is recognized if the keyword form above is missing. Finally, within entries the tilde character (~) is changed to a space character. (This is another concession to TeX.)

OPTIONS

-b  When making envelopes, do not print the postal bar code on the envelope.

-B x,y
    Specify the position of the barcode, in millimeters, to the right of the center of the envelope and above the bottom of the envelope.

-d  Make a directory on the output file. Each entry contains the name, address, and special comment fields. The format of the directory is simple ASCII by default, but TeX or PostScript may also be produced (See the -t and -p options).

-e  Write PostScript(tm) to the standard output to make an addressed envelope. The PostScript generated will consist of an internal header file (or your own custom header if you used the -h option), followed by instructions for the address entry you looked up, a return address (normally from the file "filoreturn") and a "showpage" command. The header will only be inserted once, regardless of the number of filodex entries which match. See the section on making envelopes below.

-E x,y
    Specify the size of the envelopes in millimeters. The default is a USPS com10 envelope (241mm by 105mm).

-f filodex
    Specify an alternate filodex to use in the place of ".filodex".

-h header
    Specify an alternate header file to use in place of the internal one.

-i  Ignore case when matching patterns.

-o output-file
    Specify the name of the PostScript output file, which is "-" (standard output) by default.

-p  Make a directory and use PostScript format.

-O  When making envelopes, draw an outline around the envelope. This helps to get your printer feeder set correctly.

-P x,y
    Specify a relative change in position of the entire envelope, in millimeters. This is provided to make adjustments for printers whose feeders are different from the Apple LaserWriter, for which the defaults were generated. As many -P options as you want may be specified; unlike the other positioning options the results are cumulative.

-r return
    Specify an alternate return address file to use in place of "filoreturn".

-R x,y
    Specify the position of the return address, in millimeters, from the left and top of the envelope.

-s stamp
    Specify an alternate stamp file to use in place of "filostamp".

-S x,y
    Specify the position of the stamp, in millimeters, from the right and top of the envelope.

-t  Make a directory and use TeX format.

-T x,y
    Specify the position of the mailing address, in millimeters, to the right of and above the center of the envelope.

@setting
    Read the file setting for additional command-line arguments. These get added to the end of the argument list and processing continues. Thus, settings files may contain further references to other settings files.

MAKING ENVELOPES
The files "filoreturn", and "filostamp" contain raw PostScript commands. The environment variables FILORETURN and FILOSTAMP are checked for values which will override the defaults. Command-line specifications override all other settings for these files. The default header contains a macro "cr" that allow these files to contain a shortcut specification of strings, like so: "(My Name) cr (My address) cr". The USPS postal barcodes are gleaned from the last line of the address. Both 5-digit and 9-digit codes are coded by filo.

FILES
~/.filo/filodex, ~/.filo/filoreturn, ~/.filo/filostamp.

SEE ALSO
regexp(3), regcomp(3), re_format(7).

BUGS

The TeX constructions for European characters (such as "Garci'a") should be parsed and converted to PostScript equivalants in a re-mapped font. The font re-mapping is in place, but the parser is not. The code used to grok the zip code from the address is not very robust. The usage of a POSIX system's regular expression facility is minimal; more features are available than are supported by filo. You might need to monkey with the PostScript in the header to get it to work correctly with your printer. The strategy I've used is to always use a manual sheet feeder, and feed the envelopes in lengthways. Departures from this scheme will require changes to the PostScript procedure filostart, and possibly the page setup portion of the header.

AUTHOR

filo was written by David Deaven while at the University of California, Berkeley Physics department, 1993; refined at Ames Laboratory USDOE and the University of Minnesota by Jennifer and David Deaven, 1994. The current code is Copyright (C) 1995 David Deaven and Jennifer Corkill.