diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /man/1/sh-csv | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'man/1/sh-csv')
| -rw-r--r-- | man/1/sh-csv | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/man/1/sh-csv b/man/1/sh-csv new file mode 100644 index 00000000..56ba9fc2 --- /dev/null +++ b/man/1/sh-csv @@ -0,0 +1,66 @@ +.TH SH-CSV 1 +.SH NAME +csv, getcsv \- parse ``comma-separated values'' +.SH SYNOPSIS +.B load csv + +.B getcsv +.I command +.br +.B ${csv +.IB list } +.br + +.SH DESCRIPTION +.B Csv +is a loadable module for +.IR sh (1) +that provides the facility to parse and generate +``comma-separated value'' lists, a widely used +data exchange format. +Data in this format is usually in the form of a table, +each row of which contains one or more items, +each separated by a comma +.RB ( , ). +Items that contain +a comma or a newline are surrounded with double-quotes +(\f5"\fP). +A double-quote within an item is represented by a pair +of double-quotes. +Two primitives are provided: +.TP 10 +.B getcsv +.B Getcsv +works similiarly to +.B getlines +in +.IR sh-std (1). +It reads from the standard input, and for every line read, +invokes +.I command +with +.B $line +set to the items found on that line (one element per item). +.B Getcsv +recognises the usual loop +.B break +and +.B continue +exceptions. +.TP +.B ${csv} +.B Csv +yields a single element containing all the items in +.IR list , +comma-separated and quoted as necessary. +.SH SOURCE +.B /appl/cmd/sh/csv.b +.SH SEE ALSO +.IR sh (1), +.IR sh-std (1) +.SH BUGS +Empty lines are ambiguous: +.B csv +treats an empty line as containing a single, +empty element; there is thus no way of +representing an line containing no elements at all. |
