From: Max Russell Date: 2007-09-13T00:39:01+09:00 Subject: Re: CVS parsing, counting rows and row items James Gray wrote: > On Sep 12, 2007, at 9:57 AM, Felix Windt wrote: > >> If all you want to do is count rows in a CSV file, you're just >> counting >> lines in a file and don't need the CSV library. > > CSV fields can contain line ending characters which could throw of > your counts. Use a CSV parser unless you are sure about the data > content. > > James Edward Gray II def parsecv(filehandle) csvarrays = CSV.read(filehandle) numrows = (csvarrays.length) - 1 return numrows end I ended up using a CSV.read method because it returns an array of arrays. This makes it quite easy to lop of the titles row returning a row count. Now to start getting the count of individual terms from a column... -- Posted via http://www.ruby-forum.com/.