Sebastian Hungerecker
9/23/2007 6:43:00 PM
Lee Jarvis wrote:
> 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..
Hash[*File.read(filename).scan(/^.*=.*$/).flatten]
HTH,
Sebastian
--
NP: Black Sabbath - Dirty Women
Jabber: sepp2k@jabber.org
ICQ: 205544826