home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3648 / pindex.lp < prev    next >
Text File  |  1991-07-16  |  5KB  |  263 lines

  1.  
  2.  
  3.  
  4.      pindex(1)               UNIX System V             pindex(1)
  5.      pindex(1)               UNIX System V             pindex(1)
  6.      pindex(1)               UNIX System V             pindex(1)
  7.      pindex(1)               UNIX System V             pindex(1)
  8.  
  9.  
  10.  
  11.      NAME
  12.      NAME
  13.      NAME
  14.      NAME
  15.       pindex - primitive file indexer
  16.  
  17.      SYNTAX
  18.      SYNTAX
  19.      SYNTAX
  20.      SYNTAX
  21.       pindex [ -______ ] ______ _______ [ ________ ... ]
  22.       pindex   -number   infile outfile   outfile2    
  23.       pindex   -                    
  24.       pindex   -                    
  25.  
  26.      DESCRIPTION
  27.      DESCRIPTION
  28.      DESCRIPTION
  29.      DESCRIPTION
  30.       ______ takes an input    file and produces from it an indexed
  31.       Pindex                        
  32.       version. In the default case,    it assumes that    each line of
  33.       the input file is one    record,    and writes to the (sole)
  34.       output file a    file of    the following format:
  35.  
  36.       +  The first long int    is the number of items in the file
  37.       o                            
  38.          (call it _).
  39.               n    
  40.  
  41.       +  The next _    long ints are the byte indexes in the output
  42.       o          n                        
  43.          file of the start of each item.  If you're    trying to get
  44.          the _th item, the _th index will point at its start, and
  45.          i           i                
  46.          the (_+1)th index will point at the byte after its    end.
  47.           i                        
  48.  
  49.       +  The next long int is the byte index of an imaginary byte
  50.       o                            
  51.          one past the last in the file.  It's provided so that you
  52.          can retrieve the last element in the file uniformly.
  53.  
  54.       +  Finally the data items from the input file    are presented,
  55.       o                            
  56.          with no delimiters, in the    order in which they appeared
  57.          in    the input file.
  58.  
  59.       If you specify the -______ option, the input file is to be
  60.                   number                
  61.       treated as containing    groups of ______ lines,    and ______
  62.                       number        pindex
  63.       will create ______ output files, one for the first items in
  64.               number                    
  65.       each group, one file for the second, and so forth.
  66.  
  67.      OPTIONS
  68.      OPTIONS
  69.      OPTIONS
  70.      OPTIONS
  71.       -______
  72.       -number
  73.       -    
  74.       -    
  75.            Treat the input file as containing groups of ______
  76.                                 number
  77.            lines, and create ______    output files, one for the
  78.                  number                
  79.            first items in each group, one file for the second, and
  80.            so forth.
  81.  
  82.      EXAMPLES
  83.      EXAMPLES
  84.      EXAMPLES
  85.      EXAMPLES
  86.       If you had a file called ______ containing
  87.                    states    
  88.  
  89.            Florida
  90.            Georgia
  91.            Peru
  92.  
  93.       and issued the command
  94.  
  95.            pindex states states.pin
  96.  
  97.       the resulting    ______.___ file    would have the following
  98.             states pin                
  99.  
  100.  
  101.  
  102.      Page 1                         (printed 7/16/91)
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.      pindex(1)               UNIX System V             pindex(1)
  110.      pindex(1)               UNIX System V             pindex(1)
  111.      pindex(1)               UNIX System V             pindex(1)
  112.      pindex(1)               UNIX System V             pindex(1)
  113.  
  114.  
  115.  
  116.       contents (on a big-endian machine with 32-bit-wide long
  117.       ints):
  118.  
  119.            \000 \000 \000 \003 \000    \000 \000 \024
  120.            \000 \000 \000 \033 \000    \000 \000 \042
  121.            \000 \000 \000 \056    F       l    o    r
  122.           i    d    a     G    e       o    r    g
  123.           i    a    P     e    r       u
  124.  
  125.       If you had a file called ______ containing
  126.                    people    
  127.  
  128.            Schmoe
  129.            Joe
  130.            Fishbeck
  131.            Leslie
  132.  
  133.       and issued the command
  134.  
  135.            pindex -2 people    lnames.pin fnames.pin
  136.  
  137.       you'd    get an ______.___ containing (under the    same
  138.                lnames pin            
  139.       circumstance as above):
  140.  
  141.            \000 \000 \000 \002 \000    \000 \000 \020
  142.            \000 \000 \000 \026 \000    \000 \000 \036
  143.           S    c    h     m    o       e    F    i
  144.           s    h    b     e    c       k
  145.  
  146.       and an ______.___ containing:
  147.          fnames    pin    
  148.  
  149.            \000 \000 \000 \002 \000    \000 \000 \020
  150.            \000 \000 \000 \023 \000    \000 \000 \031
  151.           J    o    e     L    e       s    l    i
  152.           e
  153.  
  154.      WARNINGS
  155.      WARNINGS
  156.      WARNINGS
  157.      WARNINGS
  158.       A line containing only a newline will    be treated as EOF.  (I
  159.       told you it was a primitive file indexer.)
  160.  
  161.       The number of    output files ______ can    create is limited by
  162.                      pindex            
  163.       the number of    files your system can have open    at one time.
  164.       (It would not    be difficult to    enhance    ______ so that file
  165.                         pindex        
  166.       descriptors were reused as necessary to get around this.)
  167.  
  168.       Exercise caution in the use of ______'s output files in
  169.                      pindex            
  170.       environments where files are shared among machines (as with
  171.       NFS).     In the    event that such    machines have different    byte
  172.       orderings or their C compilers use different long int    sizes,
  173.       unexpected results may occur if the programs using the files
  174.       are not prepared to compensate.  Maybe someday I'll cook up
  175.       an XDR version of this program, if I'm ever in the mood for
  176.       some serious overkill.
  177.  
  178.  
  179.  
  180.      Page 2                         (printed 7/16/91)
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.      pindex(1)               UNIX System V             pindex(1)
  188.      pindex(1)               UNIX System V             pindex(1)
  189.      pindex(1)               UNIX System V             pindex(1)
  190.      pindex(1)               UNIX System V             pindex(1)
  191.  
  192.  
  193.  
  194.      AUTHOR
  195.      AUTHOR
  196.      AUTHOR
  197.      AUTHOR
  198.       Brian    Rice.
  199.  
  200.       (Internet)  ____@__-___.__.___
  201.               rice dg rtp dg com
  202.  
  203.       (UUCP)      ...!____!___!_____!____
  204.               mcnc rti xyzzy rice
  205.  
  206.       (BITNET)    ______@______
  207.               BALOGA DRYCAS
  208.  
  209.       I would appreciate your notifying me of any bugs you
  210.       discover.
  211.  
  212.      COPYRIGHT
  213.      COPYRIGHT
  214.      COPYRIGHT
  215.      COPYRIGHT
  216.       This program is in the public    domain.     Everyone may use it
  217.       as he    or she sees fit.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.      Page 3                         (printed 7/16/91)
  259.  
  260.  
  261.  
  262.  
  263.