所以我有一个rake任务试图像这样打开一个csv文件。
task priceupdate: :environment do
csvtoopen = open('http://www.someurlhere.com/feed.csv')
csv = CSV.foreach(csvtoopen, :headers=>true)
csv.each do |row|
#Stuff to do with rows here
end
end
出于某种原因,当我运行此任务时,它无法正常工作。 (它应该将每行添加到db(适用于其他任务))
我碰巧遇到了这个错误:
CSV::MalformedCSVError: Illegal quoting in line 1.
非常感谢任何帮助。
修改 继续前几行
"CategoryID","CategoryName","CategoryURL","EventID","EventName","EventDate","EventURL","Venue","VenueCity","VenueCountryCode","VenuePostcode","CurrentMinPrice","CurrentMaxPrice","CurrentTickets","PreSaleDate","OnSaleDate","SoldOutDate","CategoryImageURL","CategoryDescription","VenueAddress","VenueState","VenueID","AffiliatesCommissionTier","TopLevelCategory"
"1478","The Gruffalo"
萨姆