I want to merge these two files based on column $10 in file 1 (" Parent=tRNA-Tyr6.r01 ") and column $1 in file 2 (" Parent=tRNA-Tyr6.r01 "), appending column $7 from file 1 (-/+)
MY solution would go like this:
awk 'FNR==NR{a[$10]=$7;next} ($1 in a) {print $1,"2,a[$1]}' file2 file1 > Output
Hi Mo, the desired output you have put does not match what you have specified, as
Parent=tRNA-Tyr6.r01
has a + in file1 but your desired output shows a -
Also you have put the last field from file2 in the desired output, but this is not in your specification.
Anyway, if its any help the following code
awk 'NR==FNR{a[$1];next} $10 in a {print $10,$7}' file2 file1