L
Lee Jarvis
Ok guys, I have a file which looks something like this:
one=1
two=2
three=something
four=something else
I want to read each line into a hash, key=value..
I have tried something like
File.open('file').each do |line|
line.split(/=/){|a,b| #something}
but that's kind of how far i get.. The only way i know of is reading
them all into an array of arrays and turning that into a hash, Is there
a better idea?
Thanks in advance
one=1
two=2
three=something
four=something else
I want to read each line into a hash, key=value..
I have tried something like
File.open('file').each do |line|
line.split(/=/){|a,b| #something}
but that's kind of how far i get.. The only way i know of is reading
them all into an array of arrays and turning that into a hash, Is there
a better idea?
Thanks in advance