Hi Ben,
this actually did the trick:
counter = 1
name_re = /(.*)\[(.*)\{/
File.open("census.lua", "r") do |infile|
while (line = infile.gets)
if (line =~ name_re)
s_line = line.strip
c_line = s_line.size
left = c_line
right = c_line - 7
puts "#{counter}: #{s_line.slice!(2..right)}"
counter = counter + 1
end
end
end
--
Posted via http://www.ruby-forum.com/.