FASTA format: Difference between revisions

Added solution for Action!
(Added 11l)
(Added solution for Action!)
Line 57:
Rosetta_Example_1: THERECANBENOSPACE
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
</pre>
 
=={{header|Action!}}==
In the following solution the input file [https://gitlab.com/amarok8bit/action-rosetta-code/-/blob/master/source/fasta.txt fasta.txt] is loaded from H6 drive. Altirra emulator automatically converts CR/LF character from ASCII into 155 character in ATASCII charset used by Atari 8-bit computer when one from H6-H10 hard drive under DOS 2.5 is used.
<lang Action!>PROC ReadFastaFile(CHAR ARRAY fname)
CHAR ARRAY line(256)
CHAR ARRAY tmp(256)
BYTE newLine,dev=[1]
 
newLine=0
Close(dev)
Open(dev,fname,4)
WHILE Eof(dev)=0
DO
InputSD(dev,line)
IF line(0)>0 AND line(1)='> THEN
IF newLine THEN
PutE()
FI
newLine=1
SCopyS(tmp,line,2,line(0))
Print(tmp) Print(": ")
ELSE
Print(line)
FI
OD
Close(dev)
RETURN
 
PROC Main()
CHAR ARRAY fname="H6:FASTA.TXT"
 
ReadFastaFile(fname)
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/FASTA_format.png Screenshot from Atari 8-bit computer]
<pre>
Rosetta_Example_1: THERECANBENOSPACE
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATE
</pre>
 
Anonymous user