Reads a single row from Stream containing comma separated values.
By default, the result is a list containing the row's field values. Alternatively, the type-option can be used to return a structure instead of list.
For other details see csv_read/3.
If csv_read_row/3 is called numerous times with complex options, the option list should be precompiled using csv_options/2, and the resulting structure passed as Options argument.
% Given file data.csv containing the line: % a, b, 123, c d," e f " % 99, aa, bb, 123, C d ?- open("data.csv", read, S), csv_read_row(S, Row1, []), csv_read_row(S, Row2, []). Row1 = ["a", " b", 123, " c d", " e f "] Row2 = [99, " aa", " bb", 123, " C d"] ?- open("data.csv", read, S), csv_options(Options, [strip:true, type:row/_]), csv_read_row(S, Row1, Options), csv_read_row(S, Row2, Options). Row1 = row("a", "b", 123, "c d", "e f") Row2 = row(99, "aa", "bb", 123, "C d")