入力ファイルは次のようになります。
犬、白、オス 猫、紫、メス ラット、グレー、オス
そして、そのデータを1行ずつ調べて処理したいと思います。
File.open("animals.csv")
while file has next line
currentline = array with each cell being an entry in the array
if currentline[0] == dog
put "dogs are cool"
end
put "your animal is a " + currentline[0]
end
わかりますよね?ifsなどでデータ行を操作し、最後にすべて出力したい。
ありがとう