View Single Post
Old 09-26-2013, 11:26 PM   #8
atcghelix
Member
 
Location: CA

Join Date: Jul 2013
Posts: 74
Default

This work? (It assumes all sequence strings are on a single line)

Code:
awk '{if($0 ~ /^>/){print $0"_"(NR+1)/2}else{print $0}}' input.fasta > changed.fasta

Last edited by atcghelix; 09-26-2013 at 11:33 PM. Reason: Less confusing regex
atcghelix is offline   Reply With Quote