in reply to Loop to merge every two columns

A solution using regular expressions and substitution, as already shown, is probably best but just to show another way -

knoppix@Microknoppix:~$ perl -E ' > $_ = q{3851 A A G G T T}; > say; > @e = split m{( )}; > $_ = join q{}, @e[ grep { ( $_ + 1 ) % 4 } 0 .. $#e ]; > say;' 3851 A A G G T T 3851 AA GG TT knoppix@Microknoppix:~$

I hope this is of interest.

Cheers,

JohnGG