Use Bash to merge column by column between two files
Hi all,
I have two files which i want to merge column by column in bash. I have had a good look but cannot find an answer. Below are example input files and a desired output.
file1.txt
A,S,G,S,G
K,A,G,A,G
K,S,A,S,A
file2.txt
K,S,B,S,G
K,S,G,D,G
K,S,G,S,E
expected-output.txt
AK,SS,GB,SS,GG
KK,AS,GG,AD,GG
KK,SS,AG,SS,AE
The sets of input files will have a variable number of fields and a variable number of lines (however these will always be the same within sets of input files)
Many Thanks!