From: Samantha Date: 2007-03-08T01:09:58+09:00 Subject: Re: Can someone point me in the right direction? Pipe Delimited Files & Hashes... James Edward Gray II wrote: > Let me try giving you this little hint and see if it's enough: > > >> cat, sub, des = "Books|Programming|A fun book about Ruby".split("|") > => ["Books", "Programming", "A fun book about Ruby"] > >> cat > => "Books" > >> sub > => "Programming" > >> des > => "A fun book about Ruby" > > Don't be shy if you need more help! > Thank you! I really appreciate it. :) Again, I'll have to dig through and figure things out. Apparently I need another cup of coffee this morning for my synapses to fire properly. >> If someone could point me in the right direction, of possible >> libraries that would help or the such, I'd love to go read there and >> study on it and try to figure it out. Not asking for answers, just >> asking for resources. :) > > The standard CSV library will do the parsing for you, but this case > looks very simple so you probably don't need it. However, if the > first row of the file has the field names, it might be worth looking > at FasterCSV which will build the Hashes for you: Thanks! The first row does not have field names, however, I'm sure I could add them. Thanks again, James - this community is always so helpful! > > http://rubyforge.org/projects/fastercsv/ > > Hope that helps. > > James Edward Gray II > > > -- Samantha http://www.babygeek.org/ "Beware when the great God lets loose a thinker on this planet. Then all things are at risk." --Ralph Waldo Emerson