RosettaCodeData/Task/FASTA-format/FutureBasic/fasta-format.basic
2026-04-30 12:34:36 -04:00

27 lines
693 B
Text

include resources "fasta.txt" // your fasta file
void local fn ReadFASTAFile( url as CFURLRef )
open @"I", 1, url
CFStringRef dta = @""
while ( !eof(1) )
CFStringRef string = line input 1
if ( !len(string) ) then continue
if ( fn StringHasPrefix( string, @">" ) )
if ( len(dta) )
print dta
dta = @""
end if
dta = concat( dta, mid( string, 1 ), @": " )
else
dta = concat( dta, string )
end if
wend
if ( len(dta) ) then print dta
close 1
end fn
CFURLRef url
url = fn BundleURLForResource( fn BundleMain, @"fasta", @"txt", NULL ) // your fasta file name and extension
if ( url ) then fn ReadFASTAFile( url )
HandleEvents