FASTA format: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
(Realize in F#)
Line 673: Line 673:
See [https://rosettacode.org/wiki/FASTA_format#Pascal Pascal].
See [https://rosettacode.org/wiki/FASTA_format#Pascal Pascal].


=={{header|F_Sharp|F#}}==
<syntaxhighlight lang="fsharp">
//FASTA format. Nigel Galloway: March 23rd., 2023.
let fN(g:string)=match g[0] with '>'->printfn "\n%s:" g[1..] |_->printf "%s" g
let lines=seq{use n=System.IO.File.OpenText("testFASTA.txt") in while not n.EndOfStream do yield n.ReadLine()}
printfn "%s:" ((Seq.head lines)[1..]); Seq.tail lines|>Seq.iter fN; printfn ""
</syntaxhighlight>
{{out}}
<pre>
Rosetta_Example_1:
THERECANBENOSPACE
Rosetta_Example_2:
THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
</pre>
=={{header|Factor}}==
=={{header|Factor}}==
<syntaxhighlight lang="factor">USING: formatting io kernel sequences ;
<syntaxhighlight lang="factor">USING: formatting io kernel sequences ;