Input_file:
15 47123466 rs98765576 C T* 100 PASS . GT 0|0 0|0 0|0 0|0 0|0 0|0 0|0
file1:
15 47123466 rs98765576 C T
file2:
11 123345 rs9173547 A G
Output:
#IP_CHR IP_POS IP_ID IP_REF IP_ALT OP_CHR OP_POS OP_ID OP_REF OP_ALT OP_QUAL OP_FILTER OP_INFO file1_name file2_name
15 47123466 rs98765576 C T C T* 100 PASS . GT 0|0 0|0 0|0 0|0 0|0 0|0 0|0 YES NO
if entries from input file (column1,2,3,4) are present in file1 & file2, then output should have input_file(column1,2,3,4) and file1 & file2 names as header and "YES/No" below to file_name headers
I tried this
awk 'NR==FNR{firstfile[$1,$2,$4];next} ($1,$2,$4) in firstfile { print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"FILENAME }'
giving output as 15 47123466 rs98765576 C T C T* 100 PASS . GT 0|0 0|0 0|0 0|0 0|0 0|0 0|0 file1_name