Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

csv-read reads a csv file and converts it into a list of lists. Each list is one row where the items are cells and the whole file becomes a list of these lists. The lines of the file are divided by using both #\newline and #\x0d to do the splitting, but if the #\x0d occurs within quotation marks, then it is not used to split the line.

Parameter Description
file CSV file to read data from

Example

Example 1: Write a few values to a file and read them back.

./DemoConsole 
> (csv-write "test.csv" (list (list "Name" "Age" "Color") (list "John" 30 "red") (list "Mike" 20 "blue") (list "Paul" 25 "")))
> (csv-read "test.csv")
(("Name" "Age" "Color") ("John" "30" "red") ("Mike" "20" "blue") ("Paul" "25" ""))
Clone this wiki locally