Created
November 13, 2011 13:31
-
-
Save azusa/1362115 to your computer and use it in GitHub Desktop.
TDDBC抽選用プログラム
This file contains 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
#!/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