I have a file with the following format
>M03117:162:000000000-ATLWF:1:1114:22047:12565:307
TCCGAAAGT-ACAACGTGT
>M03117:162:000000000-ATLWF:1:2104:9367:8166:307
TTCGAAAGTT-GGTGAGGTGTGGG
>M03117:162:000000000-ATLWF:1:1119:11492:8271:307
TCCGAAAGTTCTCCGA-CTTGGCTTCCTAG
>M03117:162:000000000-ATLWF:1:2111:19039:8200:307
GACGAAAGTTCACCGATA-GAGGTAGAAGGTGCAGTGGGGA
I would like to manipulate and change the lines so that the 2nd line is split into two separated by "-" to a new line and the name before identified by ">" copied in the new line and renamed by _2 at the end of the name, as follows;
>M03117:162:000000000-ATLWF:1:1114:22047:12565:307
TCCGAAAGT
>M03117:162:000000000-ATLWF:1:1114:22047:12565:307_2
ACAACGTGT
>M03117:162:000000000-ATLWF:1:2104:9367:8166:307
TTCGAAAGTT
>M03117:162:000000000-ATLWF:1:2104:9367:8166:307_2
GGTGAGGTGTGGG
>M03117:162:000000000-ATLWF:1:1119:11492:8271:307
TCCGAAAGTTCTCCGA
>M03117:162:000000000-ATLWF:1:1119:11492:8271:307_2
CTTGGCTTCCTAG
>M03117:162:000000000-ATLWF:1:2111:19039:8200:307
GACGAAAGTTCACCGATA
>M03117:162:000000000-ATLWF:1:2111:19039:8200:307_2
GAGGTAGAAGGTGCAGTGGGGA
I know this could be done by awk but I can't come up with anything.
>
into a variable, use-
as field separator, and print as per requirements...