# Create a file...
open('end_separated_records', 'w') do |f|
f << %{This is record one.
It spans multiple lines.ENDThis is record two.END}
end
# And read it back in.
open('end_separated_records') { |f| f.each('END') { |record| p record } }
# "This is record one.\nIt spans multiple lines.END"
# "This is record two.END"