FASTA format: Difference between revisions

no edit summary
m (→‎{{header|Phix}}: added syntax colouring the hard way)
No edit summary
Line 507:
Rosetta_Example_1: THERECANBENOSPACE
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
</pre>
 
=={{header|Forth}}==
Developed with gforth 0.7.9
<lang forth>1024 constant max-Line
char > constant marker
 
: read-lines begin pad max-line >r over r> swap
read-line throw
while pad dup c@ marker =
if cr 1+ swap type ." : "
else swap type
then
repeat drop ;
 
: Test s" ./FASTA.txt" r/o open-file throw
read-lines
close-file throw
cr ;
Test
</lang>
{{out}}
<pre>
Rosetta_Example_1 : THERECANBENOSPACE
Rosetta_Example_2 : THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
</pre>
 
Line 575 ⟶ 600:
End</lang>
Output:
<pre>Rosetta_Example_1: THERECANBENOSPACE
<pre>
Rosetta_Example_1: THERECANBENOSPACE
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
</pre>
Anonymous user