Robert Klemme
10/27/2007 9:47:00 AM
On 27.10.2007 01:00, Phrogz wrote:
> DATA.readlines.each{ |line|
> times = line.chomp.split(",")
> unless times.empty?
> #do stuff here
> p times
> end
> }
> #=> ["Monday", "07:46", "12:04", "12:45", "17:09"]
> #=> ["Tuesday", "08:00", "12:28", "13:21", "18:09"]
> #=> ["Wednesday", "07:49", "12:05", "12:58", "18:01"]
>
>
> __END__
> Monday,07:46,12:04,12:45,17:09
> Tuesday,08:00,12:28,13:21,18:09
> Wednesday,07:49,12:05,12:58,18:01
I believe it's more efficient if you omit the ".readlines".
Kind regards
robert