Parse line: value|value
File.open("songdata") do |song_file|
songs = SongList.new
song_file.each do |line|
file, length, name, title = line.chomp.split(/\s*\|\s*/)
songs.append(Song.new(title, name, length))
end
puts songs[1]
end
Related examples in the same category