From: James Edward Gray II Date: 2009-11-04T07:38:18+09:00 Subject: Re: Faster CSV,need help with logic On Nov 3, 2009, at 4:26 PM, Mmcolli00 Mom wrote: >> >> data = FCSV.parse( DATA.read, :headers => true, >> :header_converters => :symbol, >> :return_headers => true ) > > I really like the logic in this code. It makes good but when I try > this > on my CSV file I am getting no results. Do you know where DATA in the > above code comes from? DATA is a special Ruby shortcut for easy scripting. Inside a Ruby source file you can start a line with the magic __END__ tag to end the code and start the data section. Ruby will open an IO object, point it at the data you put below __END__, and stick that object in the constant DATA for easy access. I bet you can go back and read the email where I used it and it will make more sense now. See how I just dumped the CSV under my __END__ tag? That's what the code was reading. You could replace DATA.read in your own code with File.read("path/to/ file.csv"). Or you could just put the path where I stuck DATA.read, but call FCSV.read() instead of FCSV.parse(). I hope that helps. James Edward Gray II