I have one file with 11 columns with first column as primary id - P1 second csv with three columns with first column as same primary id - P1, though not at same level in both files, I am merging both files using below command:
awk 'NR==FNR {h[$2] = $3; next} {print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,h[$2]}' first.csv second.csv > final.csv
however, getting only three columns in new csv