1 USING: help.markup help.syntax io.pathnames quotations strings ;
5 { $values { "row" "an array of fields" } }
6 { $description "parses a row from a csv stream" } ;
9 { $values { "rows" "an array of arrays of fields" } }
10 { $description "Parses a csv stream into an array of row arrays." } ;
14 { "path" pathname } { "encoding" "an encoding descriptor" }
17 { $description "Opens a file and parses it into a sequence of comma-separated-value fields." } ;
21 { "rows" "a sequence of sequences of strings" }
22 { "path" pathname } { "encoding" "an encoding descriptor" }
24 { $description "Writes a comma-separated-value structure to a file." } ;
31 { $description "Parses a string into a sequence of comma-separated-value fields." } ;
38 { $description "Writes a comma-separated-value structure to a string." } ;
41 { $values { "row" "an array of fields" } }
42 { $description "writes a row to the output stream" } ;
45 { $values { "rows" "a sequence of sequences of strings" } }
46 { $description "Writes a sequence of sequences of comma-separated-values to the output stream, escaping where necessary." } ;
49 { $values { "ch" "field delimiter (e.g. CHAR: \\t)" }
50 { "quot" quotation } }
51 { $description "Sets the field delimiter for read-csv, read-row, write-csv, or write-row words." } ;
53 ARTICLE: "csv" "Comma-separated-values parsing and writing"
54 "The " { $vocab-link "csv" } " vocabulary can read and write CSV (comma-separated-value) files." $nl
55 "Working with CSV files:"
56 { $subsections file>csv csv>file }
57 "Working with CSV strings:"
58 { $subsections string>csv csv>string }
59 "Changing the delimiter from a comma:"
60 { $subsections with-delimiter }
61 "Reading from a stream:"
62 { $subsections read-csv read-row }
63 "Writing to a stream:"
64 { $subsections write-csv write-row } ;