This is the cl-csv Reference Manual, version 1.0.6, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:51:55 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-csv
Facilities for reading and writing CSV format files
BSD
1.0.6
iterate
(system).
alexandria
(system).
cl-interpol
(system).
packages.lisp
(file).
vars.lisp
(file).
read-until.lisp
(file).
csv.lisp
(file).
parser.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-csv/cl-csv.asd
cl-csv/packages.lisp
cl-csv/vars.lisp
cl-csv/read-until.lisp
cl-csv/csv.lisp
cl-csv/parser.lisp
cl-csv/vars.lisp
packages.lisp
(file).
cl-csv
(system).
*enable-signals*
(special variable).
*quote*
(special variable).
*quote-escape*
(special variable).
*separator*
(special variable).
*always-quote*
(special variable).
*buffer-size*
(special variable).
*eof-char*
(special variable).
*escape-mode*
(special variable).
*quoted-empty-string-is-nil*
(special variable).
*read-newline*
(special variable).
*trim-outer-whitespace*
(special variable).
*unquoted-empty-string-is-nil*
(special variable).
*write-newline*
(special variable).
cl-csv/read-until.lisp
vars.lisp
(file).
cl-csv
(system).
read-into-buffer-until
(function).
cl-csv/csv.lisp
read-until.lisp
(file).
cl-csv
(system).
*default-external-format*
(special variable).
csv-data-read
(function).
csv-data-read
(condition).
csv-parse-error
(function).
csv-parse-error
(condition).
csv-row-read
(function).
csv-row-read
(condition).
data
(reader method).
(setf data)
(writer method).
do-csv
(macro).
format-csv-value
(generic function).
read-csv
(function).
read-csv-row
(function).
read-csv-sample
(function).
row
(reader method).
(setf row)
(writer method).
write-csv
(function).
write-csv-row
(function).
write-csv-value
(generic function).
%char-in
(function).
%escape-seq?
(function).
%in-stream
(function).
%out-stream
(function).
chars-in
(function).
clause-for-in-csv-1
(macro).
clause-sampling-2
(macro).
csv-reader
(reader method).
csv-reader
(reader method).
(setf csv-reader)
(writer method).
(setf csv-reader)
(writer method).
format-args
(reader method).
(setf format-args)
(writer method).
format-control
(reader method).
(setf format-control)
(writer method).
restartable-read-row
(function).
white-space?
(function).
with-csv-input-stream
(macro).
with-csv-output-stream
(macro).
cl-csv/parser.lisp
csv.lisp
(file).
cl-csv
(system).
print-object
(method).
%escape-is-double-quote
(function).
%next-char
(function).
%trim-datum
(function).
after-quoted?
(reader method).
(setf after-quoted?)
(writer method).
buffer
(reader method).
(setf buffer)
(writer method).
character-idx
(reader method).
(setf character-idx)
(writer method).
character-line-idx
(reader method).
(setf character-line-idx)
(writer method).
check-and-distpatch
(function).
check-table-entry
(method).
collect-datum
(function).
collect-row-data
(function).
csv-reader
(class).
data-map-fn
(reader method).
(setf data-map-fn)
(writer method).
delimiter
(reader method).
(setf delimiter)
(writer method).
didx
(reader method).
(setf didx)
(writer method).
dispatch
(reader method).
(setf dispatch)
(writer method).
dlen
(reader method).
(setf dlen)
(writer method).
dlen-1
(reader method).
(setf dlen-1)
(writer method).
drop-delimiter-chars
(function).
entries
(reader method).
(setf entries)
(writer method).
last-item
(function).
(setf last-item)
(function).
line-data
(reader method).
(setf line-data)
(writer method).
line-idx
(reader method).
(setf line-idx)
(writer method).
make-default-csv-reader
(function).
make-table-entry
(function).
map-empty-string-to-nil
(function).
map-fn
(reader method).
(setf map-fn)
(writer method).
parse-stream
(reader method).
(setf parse-stream)
(writer method).
read-csv-row-with-reader
(function).
read-csv-with-reader
(function).
read-dispatch-table
(class).
read-dispatch-table-entry
(class).
read-with-dispatch-table
(function).
reading-character
(function).
reading-escaped
(method).
reading-following-escaped
(method).
reading-newline
(method).
reading-quoted
(method).
reading-quoted-or-escaped
(method).
reading-quoted?
(reader method).
(setf reading-quoted?)
(writer method).
reading-separator
(method).
reset-table-entry
(function).
row-fn
(reader method).
(setf row-fn)
(writer method).
rows
(reader method).
(setf rows)
(writer method).
skip-row?
(reader method).
(setf skip-row?)
(writer method).
Packages are listed by definition order.
cl-csv
common-lisp
.
common-lisp-user
.
iterate
.
*default-external-format*
(special variable).
*enable-signals*
(special variable).
*quote*
(special variable).
*quote-escape*
(special variable).
*separator*
(special variable).
csv-data-read
(function).
csv-data-read
(condition).
csv-parse-error
(function).
csv-parse-error
(condition).
csv-row-read
(function).
csv-row-read
(condition).
data
(generic reader).
(setf data)
(generic writer).
do-csv
(macro).
format-csv-value
(generic function).
read-csv
(function).
read-csv-row
(function).
read-csv-sample
(function).
row
(generic reader).
(setf row)
(generic writer).
write-csv
(function).
write-csv-row
(function).
write-csv-value
(generic function).
%char-in
(function).
%escape-is-double-quote
(function).
%escape-seq?
(function).
%in-stream
(function).
%next-char
(function).
%out-stream
(function).
%trim-datum
(function).
*always-quote*
(special variable).
*buffer-size*
(special variable).
*eof-char*
(special variable).
*escape-mode*
(special variable).
*quoted-empty-string-is-nil*
(special variable).
*read-newline*
(special variable).
*trim-outer-whitespace*
(special variable).
*unquoted-empty-string-is-nil*
(special variable).
*write-newline*
(special variable).
after-quoted?
(generic reader).
(setf after-quoted?)
(generic writer).
buffer
(generic reader).
(setf buffer)
(generic writer).
character-idx
(generic reader).
(setf character-idx)
(generic writer).
character-line-idx
(generic reader).
(setf character-line-idx)
(generic writer).
chars-in
(function).
check-and-distpatch
(function).
check-table-entry
(generic function).
clause-for-in-csv-1
(macro).
clause-sampling-2
(macro).
collect-datum
(function).
collect-row-data
(function).
csv-reader
(generic reader).
(setf csv-reader)
(generic writer).
csv-reader
(class).
data-map-fn
(generic reader).
(setf data-map-fn)
(generic writer).
delimiter
(generic reader).
(setf delimiter)
(generic writer).
didx
(generic reader).
(setf didx)
(generic writer).
dispatch
(generic reader).
(setf dispatch)
(generic writer).
dlen
(generic reader).
(setf dlen)
(generic writer).
dlen-1
(generic reader).
(setf dlen-1)
(generic writer).
drop-delimiter-chars
(function).
entries
(generic reader).
(setf entries)
(generic writer).
format-args
(generic reader).
(setf format-args)
(generic writer).
format-control
(generic reader).
(setf format-control)
(generic writer).
last-item
(function).
(setf last-item)
(function).
line-data
(generic reader).
(setf line-data)
(generic writer).
line-idx
(generic reader).
(setf line-idx)
(generic writer).
make-default-csv-reader
(function).
make-table-entry
(function).
map-empty-string-to-nil
(function).
map-fn
(generic reader).
(setf map-fn)
(generic writer).
parse-stream
(generic reader).
(setf parse-stream)
(generic writer).
read-csv-row-with-reader
(function).
read-csv-with-reader
(function).
read-dispatch-table
(class).
read-dispatch-table-entry
(class).
read-into-buffer-until
(function).
read-with-dispatch-table
(function).
reading-character
(function).
reading-escaped
(generic function).
reading-following-escaped
(generic function).
reading-newline
(generic function).
reading-quoted
(generic function).
reading-quoted-or-escaped
(generic function).
reading-quoted?
(generic reader).
(setf reading-quoted?)
(generic writer).
reading-separator
(generic function).
reset-table-entry
(function).
restartable-read-row
(function).
row-fn
(generic reader).
(setf row-fn)
(generic writer).
rows
(generic reader).
(setf rows)
(generic writer).
skip-row?
(generic reader).
(setf skip-row?)
(generic writer).
white-space?
(function).
with-csv-input-stream
(macro).
with-csv-output-stream
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
the external format used for opening files
Should the reading and writing process enable filtering signals
Default setting for escaping quotes - by default this is a vector of #(*quote* *quote*)
row-var: a variable that is passed into _body_
stream-or-pathname: a stream or a pathname to read the CSV data from
read-csv-keys: keys and values passed to the _read-csv_ function
body: body of the macro
Writes a csv to the given stream.
rows-of-items: iterable
Keywords:
stream: stream to write to. Default: nil.
nil - writes the rows to a string and returns it
an open stream
a pathname (overwrites if the file exists)
quote: quoting character. Defaults to *quote*
escape: escaping character. Defaults to *quote-escape*
newline: newline character. Defaults to *write-newline*
always-quote: Defaults to *always-quote*
Writes a list items to stream
rows-of-items: iterable
Keywords:
stream: stream to write to. Default: nil.
quote: quoting character. Defaults to *quote*
escape: escaping character. Defaults to *quote-escape*
newline: newline character. Defaults to *write-newline*
always-quote: Defaults to *always-quote*
csv-data-read
)) ¶csv-data-read
)) ¶Print values in ways that are most cross compatible with the csv format
csv-row-read
)) ¶csv-row-read
)) ¶Writes val to csv-stream in a formatted fashion.
Keywords
formatter: used to format val. Defaults to format-csv-value.
quote: quoting character. Defaults to *quote*
escape: escaping character. Defaults to *quote-escape*
newline: newline character. Defaults to *write-newline*
always-quote: Defaults to *always-quote*
read-dispatch-table
) s) ¶Print the auto-print-items for this instance.
Default setting for always quoting
Controls how escapes are handled.
:quote - replace the entire *quote-escape* sequence with the quote
character whenever we find it. Commonly used with "" quote
escapes
:following - replace the escape character and the following character with
just the following character.
EG: (*quote-escape* #\ )
\ ->
r -> r
’ -> ’
Should empty string values, be nil or "".
Unquoted values are always trimmed of surrounding whitespace.
Quoted values are never be trimmed
Default newline string for reading.
We trim extra whitespace by default *trim-outer-whitespace*
Should white space between delimiters and data or quotes be removed
These underscores (if they were spaces) are the locations in question ’a’,_b_,_’ c ’_,_d
Should unquoted empty string values, be nil or "".
When writing what should the newline convention be
in-csv driver for iterate
resevoir sample the input
creates a stream from the given thing, trying to DWIM
returns true if any of the chars-to-check is found in the value-to-look-through
Check all the entries in a read-dispatch-table to find a match
if it matches, call the function with the table character and entry
This backs up the buffer till the delimiter is not in it
we call this without having adding the character we just got
that dispatched
Creates the default csv dispatch table
This can usually be fully changed simply by tweaking the special variables
defined in vars. You will need to reinstantiate this object when you change those variables
(which is what happens by default)
Creates a table entry ensuring everything has the correct types and values
Read a row of csv from the input
Read a whole csv from the input
This reads into a buffer until either the buffer is full or the
we have read the newline character(s).
If we read the newline characters they will be the last character(s) in the
buffer
A generic function for processing all the characters of a stream until a match arises and collecting that data as it goes
We read a random character that was not otherwise dispatched on
resets the entry state when it doesnt match
csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
Given the next character in a stream check if the table entry matches reset if it matches fully or doesnt match
csv-row-read
)) ¶csv-row-read
)) ¶csv-data-read
)) ¶csv-data-read
)) ¶csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
read-dispatch-table-entry
)) ¶automatically generated reader method
read-dispatch-table-entry
)) ¶automatically generated writer method
read-dispatch-table-entry
)) ¶automatically generated reader method
didx
.
read-dispatch-table-entry
)) ¶automatically generated writer method
didx
.
read-dispatch-table-entry
)) ¶automatically generated reader method
read-dispatch-table-entry
)) ¶automatically generated writer method
read-dispatch-table-entry
)) ¶automatically generated reader method
dlen
.
read-dispatch-table-entry
)) ¶automatically generated writer method
dlen
.
read-dispatch-table-entry
)) ¶automatically generated reader method
read-dispatch-table-entry
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
csv-parse-error
)) ¶csv-parse-error
)) ¶csv-parse-error
)) ¶csv-parse-error
)) ¶csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
read-dispatch-table
)) ¶automatically generated reader method
read-dispatch-table
)) ¶automatically generated writer method
We read an escape sequence and need to handle storing the escaped character
We read an escape sequence and need to handle storing the escaped character
We got the newline character which will be handled differently based on if we are in quoted data or not
Method to handle reading a quote
NB: this interacts wierdly with escape-mode :quote
Method to handle reading a quote or a pair of quotes
csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
We got the data separator character which will be handled differently based on if we are in quoted data or not
csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
csv-reader
)) ¶automatically generated reader method
rows
.
csv-reader
)) ¶automatically generated writer method
rows
.
csv-reader
)) ¶automatically generated reader method
csv-reader
)) ¶automatically generated writer method
the state of the csv reader, which is also is a read table
(make-array 10 :element-type (quote list) :initial-element nil :adjustable t :fill-pointer 0)
cl-csv::rows
rows
.
(make-array 10 :element-type (quote string) :initial-element "" :adjustable t :fill-pointer 0)
:row-fn
:map-fn
(quote cl-csv::map-empty-string-to-nil)
:data-map-fn
:skip-row?
A stream parser that collects characters
and when a certain delimiter is matched will call a certain function.
These delimiter / function pairs are read-dispatch table entries
It contains all the state for the parse process
See: csv-reader
:parse-stream
(make-array cl-csv::*buffer-size* :element-type (quote character) :initial-element #\nul :adjustable t :fill-pointer 0)
:buffer
:entries
0
:line-idx
0
:character-line-idx
0
:character-idx
When a certain delimiter is matched it will call a certain function
T matches anything
create these with make-table-entry
(or (vector (or boolean character)) null)
:delimiter
fixnum
-1
:dlen-1
(or function null)
:dispatch
Jump to: | %
(
A B C D E F G L M P R S W |
---|
Jump to: | %
(
A B C D E F G L M P R S W |
---|
Jump to: | *
A B C D E F L M P R S |
---|
Jump to: | *
A B C D E F L M P R S |
---|
Jump to: | C F P R S V |
---|
Jump to: | C F P R S V |
---|