# (libruby) reading a file line by line

**URL:** <https://www.ruby-forum.com/t/libruby-reading-a-file-line-by-line/61631>\
**Category:** Ruby\
**Created:** [May 25, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/libruby-reading-a-file-line-by-line/61631 "2006-05-25T19:34:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![splashlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@splashlin](https://www.ruby-forum.com/u/splashlin)\
**Post date:** [May 25, 2006, 7:34pm UTC](https://www.ruby-forum.com/t/libruby-reading-a-file-line-by-line/61631/1 "2006-05-25T19:34:32Z")

</div>

Hi All,

Basically what I would like to do is read a file in line by line  
chomping  
the line on the way. It’s easy enough in c but I would like to do it  
using  
the functionality from libruby.

I’ve go the file object using rb\_file\_open(), can someone suggest how I  
might use each\_line to do what I want to?

Cheers,  
Phil
