Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!haroldt From: haroldt@paralandra.yorku.ca (Harold Tomlinson) Newsgroups: comp.unix.questions Subject: Re: Attn: AWK GURUS (Generic Search) Message-ID: Date: 28 Feb 91 14:02:15 GMT References: <354@marst2> Sender: news@yunexus.YorkU.CA Followup-To: comp.unix.questions Organization: York Computing Services Lines: 63 In-reply-to: vwa0201@marst2's message of 27 Feb 91 19:48:08 GMT Sorry to post this to the net, but, I could not reach the above addr via email. In article <354@marst2> vwa0201@marst2 (Larry Baca) writes: :> 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. :> ----- Transcript of session follows ----- 550 ... Host unknown ----- Unsent message follows ----- Received: by paralandra.yorku.ca (5.57/Ultrix3.0-C) id AA17172; Thu, 28 Feb 91 08:55:21 EST To: vwa0201@marst2 Subject: Awk db search question. Date: Thu, 28 Feb 91 08:55:18 -0500 From: haroldt@paralandra.yorku.ca I don't think I fully understood what you were asking. Did you want column input (as in Sas column input) or variable columns? You wrote: 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 Let's say there is a col1 (a string). What did you want in col1 for each of these rows? abc, a, ab? or a,a,a? May I suggest that you look into the substring function for AWK. ====================================================================== === Harold Tomlinson === == Computing and Communications Services == = YORK UNIVERSITY = = haroldt@paralandra.yorku.ca = = 416- 736-5257-33802 = ====================================================================== -- ====================================================================== === Harold Tomlinson === == Computing and Communications Services == = YORK UNIVERSITY = = haroldt@paralandra.yorku.ca = = 416- 736-5257-33802 = ======================================================================