Skip to content

Instantly share code, notes, and snippets.

@azusa
Created November 13, 2011 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azusa/1362115 to your computer and use it in GitHub Desktop.
Save azusa/1362115 to your computer and use it in GitHub Desktop.
TDDBC抽選用プログラム
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "CSV"
list=Array.new
rows = CSV.open(ARGV[0],"rb:windows-31j")
rows.shift
rows.each do |row|
list.push row
end
list =list.sort_by{|i| rand}
list.each do |row|
row.each do |col|
if col != nil then
print "¥""
print col.encode("windows-31j")
print "¥""
print ","
else
print ","
end
end
print rand(10000)
print "¥n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment