File Mem.txt
[root@mavenir Sudhakar]# cat MEM.txt | awk '{print $4,$5}'
Output:
CARD_0-1 12
CARD_0-10 13
CARD_0-11 13
CARD_0-12 28
CARD_0-13 2
CARD_0-14 2
CARD_0-2 30
CARD_0-3 13
CARD_0-4 29
CARD_0-9 24
CARD_1-1 13
CARD_1-10 28
CARD_1-11 13
CARD_1-12 28
CARD_1-13 29
CARD_1-14 13
CARD_1-2 30
CARD_1-3 13
CARD_1-4 28
CARD_1-5 10
CARD_1-6 28
CARD_1-9 13
[root@mavenir Sudhakar]# cat cardnum.txt
0-1
0-3
0-11
1-1
1-3
1-5
1-9
1-11
1-13
these are the two file where i need to select the value of the 2nd value from the MEM.txt file is the card num exist in cardnum.txt file.
the output should be like this
0-1 12
0-3 13
0-11 13
1-1 13
1-3 13
1-5 10
1-9 13
1-11 13
1-13 29