Date: Wed, 12 Jan 2000 15:01:15 +0530 From: "SIVARAM N" <sivaramn@wipsys.ge.com> To: <freebsd-newbies@FreeBSD.ORG> Subject: awk: working with multiple files Message-ID: <002901bf5cdf$c696d7a0$8b2fa8c0@wipsys.ge.com>
next in thread | raw e-mail | index | archive | help
Hi,
I have 2 files both of which are sorted on one column.
File1 file2
-------- --------
CCLC CCLA <desc>
CCLD CCLC <desc>
CCLK CCLD <desc>
... CCLE <desc>
...
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002901bf5cdf$c696d7a0$8b2fa8c0>
