source: project/wiki/eggref/4/csv @ 15787

Last change on this file since 15787 was 15787, checked in by Ivan Raikov, 11 years ago

typo fixes

File size: 3.1 KB
Line 
1[[tags: eggs]]
2[[toc:]]
3
4== csv
5
6=== Description
7
8The {{csv}} library contains a procedure for parsing of
9comma-separated values (CSV) as described in
10[[http://tools.ietf.org/html/rfc4180|RFC 4180]]. There are several
11differences with the RFC:
12
13* The RFC prescribes CRLF standard network line breaks, but many CSV
14files have platform-dependent line endings, so this library accepts
15any sequence of CRs and LFs as a line break.
16* The format of header lines is exactly like a regular record and the
17presence of a header can only be determined from the mime type.  This
18library treats all lines as regular records.
19* The formal grammar specifies that fields can contain only certain US
20ASCII characters, but the specification of the MIME type allows for
21other character sets. This library allow all characters in fields,
22except for the field delimiter character, CRs and LFs in unquoted
23fields.
24* According to the RFC, the records all have to have the same
25length. This library allows variable length records.
26* The delimiter character is specified by the user and can be a
27character other than comma, or an SRFI-14 character set.
28
29
30=== Library Procedures
31
32* <procedure>(make-parser [DELIMITER]) => PARSER</procedure>
33
34Returns a CSV parsing procedure. Optional argument {{DELIMITER}}
35specifies the field delimiter (comma by default). {{DELIMITER}} can be
36a character, or an SRFI-14 character set. The returned procedure takes
37in a string and returns a list of the form:
38
39  ((record STRING1 STRING2 ...) (record ... ))
40
41where {{STRING}} represents the field values in a record.
42
43=== Requires
44
45* [[abnf]]
46
47=== Version History
48
49* 1.0 Initial Release
50
51=== License
52
53  Copyright 2009 Ivan Raikov.
54  All rights reserved.
55 
56  Redistribution and use in source and binary forms, with or without
57  modification, are permitted provided that the following conditions are
58  met:
59 
60  Redistributions of source code must retain the above copyright
61  notice, this list of conditions and the following disclaimer.
62 
63  Redistributions in binary form must reproduce the above copyright
64  notice, this list of conditions and the following disclaimer in the
65  documentation and/or other materials provided with the distribution.
66 
67  Neither the name of the author nor the names of its contributors may
68  be used to endorse or promote products derived from this software
69  without specific prior written permission.
70 
71  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
72  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
73  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
74  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
75  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
76  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
77  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
78  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
79  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
80  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
81  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
82  OF THE POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.