[comp.unix.questions] Using the dbm libraries correctly...

dls@cci632.UUCP (Darren Swartzendruber) (12/01/89)

I have been trying to use the dbm libraries provided on my
system to index a file, but since documentaion is sketchy
at best, I thought I'd give it try here.

For starters, I am on a 4.2BSD box.

I have been able to write a quick index and search problem
using the library libndbm.a.  The problem is that what I
want to do is search for a key and have EVERY occurrance of
that key printed.  I am trying to index text, where the key
is a word and its contents is the sentence the word occurs in.

For example, I search for the word "the" (now I really wouldn't
do that, but this is an example).  I would like every sentence 
that the word "the" occurs in to be printed.  Right now, all
I get is the first occurance and that is it.  I have even dumped
out all the keys in the db and notice that keys only appear once,
even if the word occurs 100 times in the text that I indexed.

I anyone can help me, I'd be appreciative.  We can continue
via e-mail.

Darren Swartzendruber       CCCCCCCCCCC CCCCCCCCCCC IIIIIIIIII
                            CC       CC CC       CC II      II  COMPUTER
dls@cci632                  CC  CCC  CC CC  CCC  CC IIII  IIII  CONSOLES,
rochester!rit!cci632!dls    CC  CCCCCCC CC  CCCCCCC IIII  IIII  INCORPORATED
uunet!ccicpg!cci632!dls     CC  CCC  CC CC  CCC  CC IIII  IIII
uunet!rlgvax!cci632!dls     CC       CC CC       CC II      II  An STC Company
rayssd!cci632!dls           CCCCCCCCCCC CCCCCCCCCCC IIIIIIIIII