Read CSV file : csv « Development « Ruby






Read CSV file


require 'csv'
IO.foreach("data.csv") { |f| p CSV::parse(f.chomp) }

 








Related examples in the same category

1.Update a CSV file
2.Parse one CSV file line
3.Create data for CSV file
4.Reading and Searching CSV Data
5.use CSV alongside the File class
6.loading the data from a CSV-formatted file into an array is with CSV.read:
7.pick out the first person in the data called Laura:
8.find the people in your database whose ages are between 20 and 40:
9.Saving Data Back to the CSV File