Ruby CSV Functions

EditRocket provides the following information on CSV functions in the Ruby source code builder.

foreach(path, rs = nil, &block) -

generate(path, fs = nil, rs = nil, &block) -

generate_line(row, fs = nil, rs = nil) - Create a line from cells. each cell is stringified by to_s.

generate_row(src, cells, out_dev, fs = nil, rs = nil) - Convert a line from cells data to string. Consider using CSV.generate_line instead. To generate multi-row CSV string, see EXAMPLE below.

open(path, mode, fs = nil, rs = nil, &block) - Open a CSV formatted file for reading or writing.

parse(str_or_readable, fs = nil, rs = nil, &block) - Parse lines from given string or stream. Return rows as an Array of Arrays.

parse_line(src, fs = nil, rs = nil) - Parse a line from given string. Bear in mind it parses ONE LINE. Rest of the string is ignored for example "a,b\r\nc,d" => ['a', 'b'] and the second line 'c,d' is ignored.

parse_row(src, idx, out_dev, fs = nil, rs = nil) - Parse a line from string. Consider using CSV.parse_line instead. To parse lines in CSV string, see EXAMPLE below.

read(path, length = nil, offset = nil) -

readlines(path, rs = nil) -