title: Read data from csv file with foreach function
body: <p>I have been reading data from csv, if there is a large csv file, for avoid this time-out(rack 12 sec timeout) i have read only 25 rows from csv after 25 rows it return and again make a request so this will continue until read all the rows.</p>
  
  <pre><code>def read_csv(offset)
    r_count = 1
    CSV.foreach(file.tempfile, options) do |row|
    if r_count &gt; offset.to_i
      #process
    end
    r_count += 1
  end
  </code></pre>
  
  <p>But here it is creating a new issue, let say first read 25 rows then when the next request comes offset is 25 that time it will read upto first 25 rows then it will start read from 26 and do process, so how can i skip this rows which already read?, i tried this <strong>if next</strong> to skip iteration but that fails, or is there any other efficient way to do this?</p>