Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do nested awk?

Status
Not open for further replies.

annietech

Programmer
Aug 8, 2005
8
US
I have two files, one is:
/data/oracle/R1LD/data01/ 3338445
/data/oracle/R1LD/data02/ 3361894
/data/oracle/R1LD/data03/ 3441971
/data/oracle/R1LD/data04/ 3347558
/data/oracle/R1LD/data05/ 3380326

second file is:
24043288
23861576
23067040
24003800
2871648

For each line, I need to return the first record in file one if the second record of that file is bigger than the second file.

I have been getting many syntax erros when I tried using an awk inside an awk! Could someone give me some guidelines or suggest if there's another way to do it?

Thanks a lot in advance!
 
And what have you tried so far ?
What is the expected result with your posted samples ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Thank you for your reply. I managed to do it using "paste" to join the columns of these two files - making things much easier than using nested AWK

Cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top