I have a large file with the following format tab-separated:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT recombination
chr1 586001 >63041388>63041391 G A 60 . AC=80;AF=0.3125;AN=256;AT=>63041388>63041390>63041391,>63041388>63041389>63041391;NS=3;LV=0 GT 1|2|3|
Now, the last column the 10th one appears as many numbers divided by a pipe |; however, what I wish to achieve is the following:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT recombination
chr1 586001 >63041388>63041391 G A 60 . AC=80;AF=0.3125;AN=256;AT=>63041388>63041390>63041391,>63041388>63041389>63041391;NS=3;LV=0 GT 1|1 2|2 3|3
I managed to separate the columns with tab by replacing the | symbol, that leaves me with how to duplicate them and add back the | between numbers. I attempted few times with for loops but the best I can do is printing only two columns as such:
1 1
2 2
3 3
...
otherwise with printf I get a one-line output but cannot keep the counter the same value of the initial column...
Any help is much appreciated, thanks in advance!