CSV::Lexer
A CSV lexer lets you consume a CSV token by token. You can use this to efficiently parse a CSV without the need to allocate intermediate arrays.
require "csv"
lexer = CSV::Lexer.new "one,two\nthree"
lexer.next_token # => CSV::Token(@kind=Cell, @value="one")
lexer.next_token # => CSV::Token(@kind=Cell, @value="two")
lexer.next_token # => CSV::Token(@kind=Newline, @value="two")
lexer.next_token # => CSV::Token(@kind=Cell, @value="three")
lexer.next_token # => CSV::Token(@kind=Eof, @value="three")
Constructors
Instance methods
quote_char
Sourceseparator
Source