title: ruby net-sftp read file line by line
body: <p>I am using ruby 2.0.0 and rails 4.0.0. I have something similar to this:</p>
  
  <pre><code>require 'net/sftp'
  
  
   sftp = Net::SFTP.start('ftp.app.com','username', :password =&gt; 'password')
  
   sftp.file.open("/path/to/remote/file.csv", "r") do |f|
      puts f.gets
   end 
  </code></pre>
  
  <p>This opens the file on the FTP site, but it only <code>puts</code> the first line of the csv file. I need to read this file row by row, preferably ignoring the header.</p>
  
  <p>How can I read the file row by row, without downloading the file locally?</p>