Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Random Sampling of CSV in Ruby
require 'csv'
csvs = (1..13).map{|i|"data#{i}.csv", "w")}
CSV.foreach("datagrants.csv") do |row|
puts row # TODO remove
csvs.sample << row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.