Entering edit mode
5.1 years ago
SaltedPork ▴ 170
Hi, I have a string of a fasta file (see below). You can see it's already in a fasta format, but its got spaces in the ID, and has newline characters. I have a Perl solution for this, but it's a bit hokey. I was wondering if any of you have the bash skills to turn this into a regular fasta?
">GA1redu 691-707f 57.9 product 2894bp 2006\r\nGCAGGACTCGGCTTGCT\r\n>HIVRES2redu \r\nGCTCTTGATAAATTTGATATGTCCAT"
>GA1redu 691-707f 57.9 product 2894bp 2006 GCAGGACTCGGCTTGCT >HIVRES2redu GCTCTTGATAAATTTGATATGTCCAT
Another way is to use sed -
echo -e '.....' | sed 's/\r//g'- which remove "\r" in your text.