Created
May 10, 2015 02:12
-
-
Save k4zy/173c2a508d9df0e2d940 to your computer and use it in GitHub Desktop.
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
csv = <<'EOS' | |
勝海舟 コンパイラ C++プログラミング | |
勝海舟 コンパイラ Javaプログラミング | |
坂本龍馬 コンパイラ C++プログラミング | |
坂本龍馬 コンパイラ Ruby on Rails | |
坂本龍馬 データベース Ruby on Rails | |
坂本龍馬 データベース リレーショナルモデル | |
桂小五郎 コンパイラ Javaプログラミング | |
桂小五郎 コンピュータアーキテクチャ Javaプログラミング | |
桂小五郎 コンピュータアーキテクチャ オペレーティングシステム | |
桂小五郎 コンピュータアーキテクチャ コンピュータアーキテクチャ原理 | |
EOS | |
csv.split("\n").each do |line| | |
values = line.split(" ").map{|value|"'#{value}'"}.join(', ') | |
puts "insert into name_major_lesson values(#{values});" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment