From: James Britt Date: 2005-12-02T11:10:49+09:00 Subject: Re: Labelled text file parsing... CBlair1986 wrote: > Hi. What I'd like to do is to take a file like so: > --- > Apple > Color: Red > Peel: Yes > Has Core: Yes > > Orange > Color: Orange > Peel: Yes > Has Core: No How is this file created? It looks very much like YAML, and Ruby ships with a YAML parser, so if you have any say over the file format, make it valid YAML. Something like this: Apple : Color: Red Peel: Yes Has Core: Yes Orange : Color: Orange Peel: Yes Has Core: No James -- http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools