I am trying to manipulate a FASTA file with the general format:
>ReadID other text
ACTGACTGACTGACTGACTGACTGACTGACTGACTG
>ReadID other text
ACTGACTGACTGACTGACTGACTGACTGACTGACTG
>ReadID other text
ACTGACTGACTGACTGACTGACTGACTGACTGACTG
I was attempting to take the read (ACTG...) and append it to the end of the row with the ReadID using
paste -sd "\t\n" input.file > output.file
This works just as it should, except that for whatever reason, some of the reads are intentionally split over two lines:
>ReadID other text
ACTGACTGACTGACTGACTGACTGACTGACTG
ACTG
This means I can't just simply replace line breaks with tab-delimiters.
I guess the thing to do is to take all lines that fall between lines starting with >
and combine them into a single line. How might I go about combining all lines that fall between >
into a single line?