# Possible to get a row count from Faster::CSV w/out parsing?

**URL:** <https://www.ruby-forum.com/t/possible-to-get-a-row-count-from-faster-csv-w-out-parsing/108083>\
**Category:** Ruby\
**Created:** [June 28, 2007, 11:13pm UTC](https://www.ruby-forum.com/t/possible-to-get-a-row-count-from-faster-csv-w-out-parsing/108083 "2007-06-28T23:13:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [June 28, 2007, 11:13pm UTC](https://www.ruby-forum.com/t/possible-to-get-a-row-count-from-faster-csv-w-out-parsing/108083/1 "2007-06-28T23:13:03Z")

</div>

All,

I’m using Faster::CSV to process CSV files. It appears that the only  
way to get the number of rows in my CSV file is to call one of the  
methods which actually reads through all of the data, like read().

Is this correct? It makes sense that it would be this way, just  
wondering.

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [June 28, 2007, 11:24pm UTC](https://www.ruby-forum.com/t/possible-to-get-a-row-count-from-faster-csv-w-out-parsing/108083/2 "2007-06-28T23:24:54Z")

</div>

On Jun 28, 2007, at 4:13 PM, Wes G. wrote:

> I’m using Faster::CSV to process CSV files. It appears that the only  
> way to get the number of rows in my CSV file is to call one of the  
> methods which actually reads through all of the data, like read().
> 
> Is this correct? It makes sense that it would be this way, just  
> wondering.

That’s correct. It’s impossible to know a row count without parsing  
CSV content since fields can contain embedded line endings.

James Edward G. II
