I have a table called baitmap.txt. In $5, different gene names are separated by ",".
baitmap.txt
1 831895 848168 218 RP11-54O7.1-001
1 848169 850618 219 RP11-54O7.2-001
1 850619 874081 220 SAMD11-011,SAMD11-003,SAMD11-010,SAMD11-001,SAMD11-004
1 889424 903640 223 NOC2L-001
1 903641 927394 224 C1orf170-001,C1orf170-201
1 927395 936954 225 HES4-002,HES4-001,HES4-004
1 943677 957199 228 RP11-54O7.11-001
1 1005127 1034268 234 RNF223-201
1 1049052 1062659 239 C1orf159-002,C1orf159-001,C1orf159-004,C1orf159-009,C1orf159-011,C1orf159-017,C1orf159-016,C1orf159-203,C1orf159-201,C1orf159-204,C1orf159-202
1 1096739 1107115 246 MIR200B-201
I would like to split the names in $5 then merge the new column to the previous 4 columns separately. So it should look like this:
1 831895 848168 218 RP11-54O7.1-001
1 848169 850618 219 RP11-54O7.2-001
1 850619 874081 220 SAMD11-011
1 850619 874081 220 SAMD11-003
1 850619 874081 220 SAMD11-010
1 850619 874081 220 SAMD11-001
1 850619 874081 220 SAMD11-004
1 889424 903640 223 NOC2L-001
1 903641 927394 224 C1orf170-001
1 903641 927394 224 C1orf170-201