|
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
|