Glenn Jackman wrote: > At 2009-08-15 03:16AM, "7stud --" wrote: >> count = 1 >> >> IO.foreach("data.txt") do |line| >> if line[0, 1] == "[": >> first_piece = line.split(" ", 2)[0] >> puts "#{count}: #{first_piece[2...-2]}" > > Or replace those 2 lines with: > puts %Q{#{count}: #{ line.split('"')[1] }} I'm not a big fan of cramming stuff into one liners, but I like this: line.split('"')[1] -- Posted via http://www.ruby-forum.com/.