[comp.lang.pascal] Efficient substring search routines?

bb16@prism.gatech.EDU (Scott Bostater) (02/06/91)

In article <1991Feb5.113541.13929@marlin.jcu.edu.au> zlraa@marlin.jcu.edu.au (Ross Alford) writes:
>I have a Turbo Pascal 5.5 application that needs to do brute-force
>searches through large ASCII text files.  I currently just use the POS()
>function built into TP, and it actually does go reasonably fast.  I
>understand, though, that it is probably possible to program a faster
>search.  I'd welcome suggestions or pointers to more efficient

Yes, there are faster searches available. _Dr._Dobbs_ had an article several
months ago about faster string searches.  The code is available from 
simtel20.army.mil as PD1:<MSDOS.TURBOPAS>POSBM.ARC.  This includes two routines,
one for string searches and another specialized one for character searches. 
I've used the code, but I never benchmarked it so I can't say how much faster
it is.

-- 
Scott Bostater      Georgia Tech Research Institute - Radar Systems Analysis
"My soul finds rest in God alone; my salvation comes from Him"  -Ps 62.1
uucp:     ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!bb16
Internet: bb16@prism.gatech.edu