From owner-freebsd-newbies Wed Jan 12 1:10:25 2000 Delivered-To: freebsd-newbies@freebsd.org Received: from unknown-230-100.pilot.net (unknown-230-100.pilot.net [206.98.230.100]) by hub.freebsd.org (Postfix) with ESMTP id 81EAB150B6 for ; Wed, 12 Jan 2000 01:10:09 -0800 (PST) (envelope-from sivaramn@wipsys.ge.com) Received: from unknown-239-164.pilot.net (unknown-239-164.pilot.net [206.189.239.164]) by unknown-230-100.pilot.net with ESMTP id EAA16844 for ; Wed, 12 Jan 2000 04:10:05 -0500 (EST) Received: from gemail.wipsys.ge.com (localhost [127.0.0.1]) by unknown-239-164.pilot.net with ESMTP id EAA19847 for ; Wed, 12 Jan 2000 04:10:01 -0500 (EST) Received: from Sivaram ([192.168.47.139]) by gemail.wipsys.ge.com (Netscape Messaging Server 3.6) with SMTP id AAABAD for ; Wed, 12 Jan 2000 14:45:06 +0530 Message-ID: <002901bf5cdf$c696d7a0$8b2fa8c0@wipsys.ge.com> Reply-To: "Sivaram Neelakantan" From: "SIVARAM N" To: Subject: awk: working with multiple files Date: Wed, 12 Jan 2000 15:01:15 +0530 Organization: wipro MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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