Regex to remove new lines up to a specific character

后端 未结 5 1188
情歌与酒
情歌与酒 2021-01-27 14:41

I have a series of strings in a file of the format:

>HEADER_Text1
Information here, yada yada yada
Some more information here, yada yada yada
Even some more i         


        
5条回答
  •  生来不讨喜
    2021-01-27 15:11

    You really don't want a regex. And for this job, python and biopython are superfluous. If that's actually FASTQ format, just use sed:

    sed '/^>/ { N; N; N; s/\n/ /2g }' file
    

    Results:

    >HEADER_Text1
    Information here, yada yada yada Some more information here, yada yada yada Even some more information here, yada yada yada
    >HEADER_Text2
    Information here, yada yada yada Some more information here, yada yada yada Even some more information here, yada yada yada
    >HEADER_Text3
    Information here, yada yada yada Some more information here, yada yada yada Even some more information here, yada yada yada
    

提交回复
热议问题