William James wrote: > Ricardo Furgeson wrote: >> >> "Hello" = "hi miguel" >> the table, and wheather to use a hash or arrays. Can anyone help me >> out? > > table = {} > IO.foreach('Data') { |line| > if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x > table[ $1 ] = $2 > end > } > > puts table[ "wrong" ] Thanks for the help William, I tried the code you wrote, but I got a nil as a result...I modified the code as follows: table = {} IO.foreach('Localizable.strings'){ |line| if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "\s*/ table[ $1 ] = $2 end } am I missing something? -- Posted via http://www.ruby-forum.com/.