找回密码
 注册
搜索
热搜: java php web
查看: 298|回复: 0

ruby语言

[复制链接]
发表于 2009-1-26 04:59:22 | 显示全部楼层 |阅读模式
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 song[1]
end

怎么打开这个文件,在doc下怎么运行
("songdata") 中内容:
/jazz/j00132.mp3     |3:45| Fats Waller     | Ain't Misbenhaving'
/jazz/j00319.mp3     |2:58| Louis  Armstrong |Wonderful World
/bgrass/bg0732.mp3|4:09| Stringth in Numbers |Texas Red
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|软晨网(RuanChen.com)

GMT+8, 2024-9-20 15:35

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表