Attn: AWK GURUS (Generic Search)
Harold Tomlinson
haroldt at paralandra.yorku.ca
Fri Mar 1 01:02:15 AEST 1991
Sorry to post this to the net, but, I could not reach the above addr
via email.
In article <354 at marst2> vwa0201 at 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 <vwa0201 at marst2>... 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 at marst2
Subject: Awk db search question.
Date: Thu, 28 Feb 91 08:55:18 -0500
From: haroldt at 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 at paralandra.yorku.ca =
= 416- 736-5257-33802 =
======================================================================
--
======================================================================
=== Harold Tomlinson ===
== Computing and Communications Services ==
= YORK UNIVERSITY =
= haroldt at paralandra.yorku.ca =
= 416- 736-5257-33802 =
======================================================================
More information about the Comp.unix.questions
mailing list