From: kou@... Date: 2018-02-27T02:49:52+00:00 Subject: [ruby-core:85838] [Ruby trunk Feature#10316][Rejected] Failsafe CSV.foreach Issue #10316 has been updated by kou (Kouhei Sutou). Status changed from Assigned to Rejected You can implement it with the following code: ```ruby CSV.open(path) do |csv| loop do begin row = csv.shift rescue ArgumentError # For old csv library # ignore rescue CSV::MalformedCSVError # For the latest csv library (not released yet) # ignore else # Do what you want with "row" end end end ``` See also: https://github.com/ruby/csv/issues/25 ---------------------------------------- Feature #10316: Failsafe CSV.foreach https://bugs.ruby-lang.org/issues/10316#change-70697 * Author: tramuntanal (Oliver Valls) * Status: Rejected * Priority: Normal * Assignee: kou (Kouhei Sutou) * Target version: ---------------------------------------- I've been looking for a CSV.foreach equivalent which either - ignores malformed CSV rows - or returns a nil row or a row with a parsed success flag. Can I collaborate to develop this functionallity? Symply sending a patch here? -- https://bugs.ruby-lang.org/ Unsubscribe: