Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save viktor-evdokimov/7c20f1f5c1ea9f2a0a85c014d55632c7 to your computer and use it in GitHub Desktop.
Save viktor-evdokimov/7c20f1f5c1ea9f2a0a85c014d55632c7 to your computer and use it in GitHub Desktop.

Revisions

  1. @wrburgess wrburgess created this gist Nov 3, 2014.
    12 changes: 12 additions & 0 deletions import_and_parse_remote_csv_rails.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ```
    require 'csv'
    require 'open-uri'
    csv_text = open('http://www.vvv.hh.yyy.ggg/~hhhh/uuuu.csv')
    csv = CSV.parse(csv_text, :headers=>true)
    csv.each do |row|
    puts row
    end
    ```

    ref: http://stackoverflow.com/questions/11426475/this-code-is-able-to-read-a-csv-file-from-file-system-but-what-about-reading-fro