I have these two files:
file1.txt
0 rs3094315 0 0 C T
0 rs12562034 0 0 A G
0 rs3934834 0 0 C T
file2.txt
Chr,Pos,snp_name
1, 742429,rs3094315
Where the first column of file1 is also a Chr column, and has to be replaced by file2 chr column. However, it has to match snp to that it looks like this:
file3
1 rs3094315 0 0 C T
File2 has different row and column numbers.