Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
39
Task/FASTA-format/Oberon/fasta-format.oberon
Normal file
39
Task/FASTA-format/Oberon/fasta-format.oberon
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
MODULE Fasta;
|
||||
|
||||
IMPORT Files, Streams, Strings, Commands;
|
||||
|
||||
PROCEDURE PrintOn*(filename: ARRAY OF CHAR; wr: Streams.Writer);
|
||||
VAR
|
||||
rd: Files.Reader;
|
||||
f: Files.File;
|
||||
line: ARRAY 1024 OF CHAR;
|
||||
res: BOOLEAN;
|
||||
BEGIN
|
||||
f := Files.Old(filename);
|
||||
ASSERT(f # NIL);
|
||||
NEW(rd,f,0);
|
||||
res := rd.GetString(line);
|
||||
WHILE rd.res # Streams.EOF DO
|
||||
IF line[0] = '>' THEN
|
||||
wr.Ln;
|
||||
wr.String(Strings.Substring2(1,line)^);
|
||||
wr.String(": ")
|
||||
ELSE
|
||||
wr.String(line)
|
||||
END;
|
||||
res := rd.GetString(line)
|
||||
END
|
||||
END PrintOn;
|
||||
|
||||
PROCEDURE Do*;
|
||||
VAR
|
||||
ctx: Commands.Context;
|
||||
filename: ARRAY 256 OF CHAR;
|
||||
res: BOOLEAN
|
||||
BEGIN
|
||||
ctx := Commands.GetContext();
|
||||
res := ctx.arg.GetString(filename);
|
||||
PrintOn(filename,ctx.out)
|
||||
END Do;
|
||||
|
||||
END Fasta.
|
||||
Loading…
Add table
Add a link
Reference in a new issue