dbnormal -- Processes input data file into a canonical form


     dbnormal [-a[rchive] archive_directory
          [-b[ase] base_filename]
          [-f[ormat] format_file
          [-i[nput] input_file]
          [-n[ame] "Field_name_string"]
          [-o[utput] output_file]
          [-p[rint] "options passed to dbprint]"
          [-s[yntax] syntax_file]
          [-x[ecute] calc_file]


       -a specifies an archive directory (auto-saves .cdb files
       -b specifies a basename for the input, output, format, and syntax files
          NB that <.idb>, <.cdb>, <.fdb>, <.sdb> will be attached to this basename
       -h displays full help message
       -f specifies format file used to regenerate the input file; default parts.fdb
       -i specifies free-form data input file; default parts.idb
       -n specifies a string which lists valid field names; default Field_names:
       -o specifies canonical data output file; default parts.cdb
       -p specifies an option string passed to dbprint when parts.idb is regenerated
       -s specifies syntax data file for field checks; default parts.sdb
       -x specifies calculation rule file for post-processing: default parts.xdb
          NB post-processing does happens /after/ input file is regenerated
       -v specifies verbose processing mode; multiple -v allowed


This program will accept an input data file -- formatted as desribed below -- and compress the data into a form consisting of a single line per record, excess white space removed, and sorted using the contents of the first two fields and the primary and secondary sort keys respectively. The compressed output is written to a file and archived locally using rcs; the revision number is derived from the current date, viz: YY.MMDD .

Input records are composed of an arbitrary number of fields in arbitary order. Each field is defined by a name followed by an arbitrary character string which forms its value. Field names are arbirary non-space character strings preceeded by a unique, common to the entire file, printable character. The first character encountered when reading the input file is defined as the separation character. The field value string ends at the next encountered separation character, the end of the current record, or the end-of-file. The separation character may not be contained in the value string; no escape mechanism is provided. Finally, the record may contain arbitrary new lines and is terminated either by an empty line or end-of-file.

After compression, but before other steps, the input data is subject to a variety of internal consistency checks. The primary sort key, for instance, must be unique. The first record read must contain a list of valid field names against which all subsequent records are checked. The field values are checked against rules given (as Perl regular expressions) in the syntax file.

Upon successful completion of all of the above, the program overwrites the input file with the newly sorted records using the template given by the format file. See dbprint, the program which is invoked here, for a description of that process


None reported yet.


High Level programs

Low Level programs



Bob Goeke

RCS Information

$Id: dbnormal,v 1.13 2013/07/19 12:25:57 goeke Exp goeke $