AWK Multiple substitute

I want to reformat the following:

ID1       ID001      0       0       2       1       GG      TC      GG      CT      GG      AA      AA      AG       
ID2       ID002      0       0       2       2       GG      00      AG      CC      GG      GG      TC      CC


I want to replace only:
AA with A A
CC with C C
GG with G G
TT with T T
AC with A C
GC with G C and so on..

Please help
Thanks
I have been reading up on awk gsub, but cant figure it out.

awk ' { gsub("AA","A A");gsub("CC","C C");print } ' file

Add gsub statement for other substitutions

1 Like