include "bufio.m"; include "csv.m"; csv := load CSV CSV->PATH; init: fn(bufio: Bufio); getline: fn(fd: ref Bufio->Iobuf): list of string; quote: fn(s: string): string;
Init must be called before any other operation of the module. Bufio is the instance of the bufio(2) module that will provide the open files to be read.
Getline reads a sequence of fields in csv format from Iobuf fd, unquotes fields as required, and returns them in order in a list. It returns nil on end-of-file (or read error). An empty line is regarded as containing a single empty field.
Quote returns string s quoted as required by the csv format: the result is quoted if s contains comma, newline, or a quote (and all embedded quotes are doubled).
|CSV(2 )||Rev: Thu Feb 15 14:43:27 GMT 2007|