Entering edit mode
8.4 years ago
saamar.rajput
▴
70
I have 2 files, file 1 and file 2 with the same column numbers, column one has the chromosome number, column two has the promoter start site and column three has the promoter stop site.I want to match both files, if a match to all the three columns in file 1 is found in file 2, I want to generate an output file showing the exact three columns with a fourth one.the fourth one would show a match with a score 1 and a mismatch with a score 0.
I found the answer to match the files and output a new file at the same forum,
awk 'FNR==NR{a[$1,$2,$3]=$0;next}{if(b=a[$1,$2,$3]){print b}}' file1 file2
but I want to include the match and mismatch score column in the output file too.