In Ruby, wie Lesen von Daten Spalten-Weise aus einer CSV-Datei?

Ich weiß, wie es gemacht wird zeilenweise

CSV.foreach(filename.csv) do |row|
  puts "#{row}"
end

Aber ich bin völlig verloren Spalte weisen?

Sorry Jungs, nur gelöst ist die Frage, col_data = [] CSV.foreach(filename) {|Zeile| col_data << row[0]} puts col_data

InformationsquelleAutor Pratik Bothra | 2013-01-30

Schreibe einen Kommentar