From owner-freebsd-newbies Wed Jan 12 11:25: 6 2000 Delivered-To: freebsd-newbies@freebsd.org Received: from honk.org (cr876208-a.flfrd1.on.wave.home.com [24.112.90.129]) by hub.freebsd.org (Postfix) with ESMTP id 6F71D14CCD for ; Wed, 12 Jan 2000 11:25:03 -0800 (PST) (envelope-from mpoulin@honk.org) Received: from spectre (mpoulin@cr876208-a.flfrd1.on.wave.home.com [24.112.90.129]) by honk.org (8.9.1/8.9.1) with SMTP id OAA04524; Wed, 12 Jan 2000 14:26:49 -0500 Date: Wed, 12 Jan 2000 14:26:44 -0500 (EST) From: Marty Poulin X-Sender: mpoulin@spectre To: SIVARAM N Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: awk: working with multiple files In-Reply-To: <002901bf5cdf$c696d7a0$8b2fa8c0@wipsys.ge.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I think the people in freebsd-questions would be able to answer this better than -newbies... - M - On Wed, 12 Jan 2000, SIVARAM N wrote: > Hi, > > I have 2 files both of which are sorted on one column. > > File1 file2 > -------- -------- > > CCLC CCLA > CCLD CCLC > CCLK CCLD > ... CCLE > ... > > For every occurrence of column1 in file1, the desc should be > picked from file2 if an occurrence is found . How do you do > that? > > I think, reading the first file into an associative array in BEGIN would help > but how do I stop reading into the array after the end of the first file & work > with the 2nd file in the body ,when the files are passed through the command > line? > > Please,no Perl , as I have only awk installed currently. > > Regards, > Sivaram > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-newbies" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message