Parse one CSV file line : csv « Development « Ruby
- Ruby
- Development
- csv
Parse one CSV file line
require 'csv'
file_str = File.open("data.csv").read
rec = []; pos=nil; i=-1
c,pos = CSV::parseLine(file_str,
pos.to_i,
rec[(i+=1)]=[]) until pos == 0
Related examples in the same category