The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
getting particular text after grep from lookup file napolayan UNIX for Dummies Questions & Answers 10 10-20-2006 10:52 AM
Lookup with a file pavan_test UNIX for Dummies Questions & Answers 5 07-21-2006 10:57 AM
reverse lookup file problem Westy564 IP Networking 2 01-09-2004 02:55 PM
file lookup gillbates UNIX for Dummies Questions & Answers 6 12-12-2003 02:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-30-2007
jerome Sukumar jerome Sukumar is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 22
file Lookup using awk

Hi All,

I have two files file1 and file2(lookup file).I need to map more than one keyfields of file1 with file2.how can we achieve it using awk.

file1(max 2.2 million records)
--------------------------
680720|680721|077
680720|680721|978
680721|680722|090

file2(no idea about the record count)
---------------------------------------
680721|A|680720
680722|B|680721

Assumptions:
1)file 2 will not have any duplicate records.
2)no idea about the number of records.

Keyfields:1,2 for file1 and 3,1 for file2
Output
---------
680720|680721|077|A
680720|680721|978|A
680721|680722|090|B

Please help me how to go about.
I can try with arrays but as file2 record is not fixed, i cant take in array.please suggest me.

regards,
sukumar
  #2 (permalink)  
Old 08-30-2007
jerome Sukumar jerome Sukumar is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 22
file Lookup using awk

Duplicated the question

Last edited by jerome Sukumar; 08-30-2007 at 04:28 AM.. Reason: Duplicated the question
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0