Artificial intelligent assistant

Remove line breaks in a FASTA file I have a fasta file where the sequences are broken up with newlines. I'd like to remove the newlines. Here's an example of my file: >accession1 ATGGCCCATG GGATCCTAGC >accession2 GATATCCATG AAACGGCTTA I'd like to convert it into this: >accession1 ATGGCCCATGGGATCCTAGC >accession2 GATATCCATGAAACGGCTTA i want a second file which contains two columns. Accession numbers in first, followed by sequences in second.

Using Awk:


awk '/^>/&&NR;>1{print "";}{printf "%s",/^>/ ? $0" " : $0}' file
>accession1 ATGGCCCATGGGATCCTAGC
>accession2 GATATCCATGAAACGGCTTA

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ef43d491daee9e05d1248a0772319b59