File1 contains 2 rows :
/home/asingh549/cleanup,8
/home/vbhat94/test_bkup,8
File2 contains 3 rows :
/home/asingh549/cleanup,7
/home/vbhat94/test_bkup,7
/home/asingh699/sample/adam,1
Expected output :
/home/asingh549/cleanup,8
/home/vbhat94/test_bkup,8
/home/asingh699/sample/adam,1
I tried -
awk -F, 'NR==FNR{a[$1]=$2; next} {print $1 FS a[$1] }' File1 File2
but I get below output -
/home/asingh549/cleanup,8
/home/vbhat94/test_bkup,8
/home/asingh699/sample/adam,
The 3rd line of the output is missing number 1 after the comma.
Could someone please advice how can I get the desired output?