I have file a and file lookup and the structure is below.
vi a.txt
empid|ename|sal_grade|MANAGER_ID
1|raj|A|202
2|MAN|B|203
3|JOS|C|204
vi lookup.txt
Grade|sal|manager_id
A|$100000|202
A|$1000|099
B|$1000000|203
B|$100|011
Output:
1|raj|A|202
2|MAN|B|203
command:
awk 'BEGIN {FS=OFS="|"} NR==FNR{a[$1];next} $3 in a{print $0}' lookup.txt a.txt >matched.txt
Here in the both files grade and manager_id is common and i want to join a.txt with lookup.txt on grade and manager_id and get the data out from a.txt where it got a match from lookup.txt .I tried with below command but it will join only on column i.e on grade column but i need to join on both grade and manager id column .
Thank's in advance.