while line = ARGF.gets if /LOCUS/ =~ line print "\n----------\n",line elsif /DEFINITION/ =~ line begin print line line = ARGF.gets end until /^\w/ =~ line elsif /ACCESSION|SOURCE/ =~ line print line elsif /ORIGIN/ =~ line print line line = ARGF.gets seq = "" begin line.scan /[A-Za-z]+/ do | aChunk | seq << aChunk end line = ARGF.gets end until /\/\// =~ line print seq, "\n" end #print '*'+line end