open('pipe_separated_records', 'w') do |f| f << "This is record one.|This is record two.|This is record three."endopen('pipe_separated_records') { |f| f.readlines('|') }