Created
March 21, 2014 17:23
-
-
Save caniszczyk/9691249 to your computer and use it in GitHub Desktop.
Random Sampling of CSV in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
csvs = (1..13).map{|i| CSV.open("data#{i}.csv", "w")} | |
CSV.foreach("datagrants.csv") do |row| | |
puts row # TODO remove | |
csvs.sample << row | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment