Entering edit mode
6.7 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?
Input:
">GA1redu 691-707f 57.9 product 2894bp 2006\r\nGCAGGACTCGGCTTGCT\r\n>HIVRES2redu \r\nGCTCTTGATAAATTTGATATGTCCAT"
Ideal Output:
>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.