Attn: AWK GURUS (Generic Search)

Larry Baca vwa0201 at marst2
Thu Feb 28 06:48:08 AEST 1991


I want to do a quick generic search of a rather large data base and I want
to do the search based on certain record cols. If I have records that look
like this:

abc   defghi j klmnop  qrst uvw x y z
a bc defg hij   lmnop qrst  uvw x yz
ab c defg hi j klmn op qrst u vwxyz

And say I want to find only the records with (a) in col1, (nop) in col19-21,
(v) in col29 and (y) in col34.

I want to do this in a script where the record cols and params are left to
to the users choice.

I tried doing this with:

--
--
while true
do
  a=`line <file` || break
  do cuts of $a and compare to given params.....

--
--

But this was slower than Sadams SCUDS. Maybe 'C' is a better way to go but
if it can be done with AWK and is still reasonably fast, I would like to know 
about it. Thank you for any ideas you may have.
-- 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
LARRY BACA,                                                       marst2!lbaca
DAASO-VWA AIS, DEFENSE AUTOMATIC ADDRESSING OFFICE, WESTERN DIVISION
DDTC TRACY, TRACY CA. 95376-5057  AUTOVON 462-9391  COMERCIAL 832-9391



More information about the Comp.unix.questions mailing list