🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.database
Article #5

Re: Keyword search in Clipper/dbase ????

#5
From: leo g. divinagracia iii
Date: Thu, 02 Jun 1994 01:26
39 lines
2284 bytes
In article <2sg5b0$22ln@te6000.otc.lsu.edu>,
Venkatesh Rao <eevnr@unix1.sncc.lsu.edu> wrote:
>Hi,
>     What is the best way to do a keyword search in a pc based database
>like clipper? 
>     I have a big database file ( about 40,000 records) with a character
>field of length 100. I would like to search for a particular string and
>display all the records that meet the search condition. 
>thank you in advance
>
>_/ Venkatesh Rao                _/   					_/

at least in db4 v1.5, you can use the '$' operator.  the manual calls it
the substring operator where:

a='i love dbase'
b='ve'
?b $ a 

dbase returns a .t. since 've' is a substring of 'i love dbase'

you just gotta remember that the first character string is the one being
compared to the second one, i.e. 'a$b' returns a true is a is either
identical to b or contained within b.  

warning, this might a rather a slow process...

btw, the manual also talks about the at() and substr() functions that also
work with substrings..."but the $ operator provides a basic test that is
useful in many search routines." (db4 lang. ref. manual p.1-14)

later days...

leo d.

--
------------------------------------------------------------------------------
 \ The above does not represent OIT, UNC-CH, laUNChpad, or its other users. /
   ------------------------------------------------------------------------
Technical Details
Message-ID: <2sjcg4$e7p@samba.oit.unc.edu>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!news.onramp.net!convex!news.duke.edu!concert!bigblue.oit.unc.edu!samba.oit.unc.edu!not-for-mail
References: <2sg5b0$22ln@te6000.otc.lsu.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 100e8a,f3a35dac2dee236b
X-Google-Attributes: gid100e8a,public
X-Google-Thread: fdf39,f3a35dac2dee236b
X-Google-Attributes: gidfdf39,public
X-Google-ArrivalTime: 1994-06-03 05:32:31 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!news.onramp.net!convex!news.duke.edu!concert!bigblue.oit.unc.edu!samba.oit.unc.edu!not-for-mail
From: Leo.Divinagracia@launchpad.unc.edu (leo g. divinagracia iii)
Newsgroups: comp.database,bit.listserv.dbase-l
Subject: Re: Keyword search in Clipper/dbase ????
Date: 2 Jun 1994 01:26:28 GMT
Organization: The University of North Carolina at Chapel Hill, the Experimental Bulletin Board Service.
Lines: 39
Distribution: world
Message-ID: <2sjcg4$e7p@samba.oit.unc.edu>
References: <2sg5b0$22ln@te6000.otc.lsu.edu>
NNTP-Posting-Host: lambada.oit.unc.edu
Keywords: Clipper,dbase,search