Closed
Description
If skip_lines is not specified
Ruby3.1.3 pry(main)> require 'csv'; Tempfile.open { |t| t.write(%|"\n",""\r\n|); t.rewind; CSV.open(t.path, row_sep: "\r\n") { p _1.to_a } }
=> [["\n", ""]]
If specifying skip_lines that does not affect reading
Ruby3.1.3 pry(main)> require 'csv'; Tempfile.open { |t| t.write(%|"\n",""\r\n|); t.rewind; CSV.open(t.path, skip_lines: /xxx/, row_sep: "\r\n") { p _1.to_a } }
CSV::MalformedCSVError: Any value after quoted field isn't allowed in line 1.
Probably CSV::Parser#skip_needless_lines is the cause
Metadata
Metadata
Assignees
Labels
No labels