diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/inferno/man1/sh-csv.1 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/inferno/man1/sh-csv.1')
| -rw-r--r-- | static/inferno/man1/sh-csv.1 | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/static/inferno/man1/sh-csv.1 b/static/inferno/man1/sh-csv.1 new file mode 100644 index 00000000..830efe21 --- /dev/null +++ b/static/inferno/man1/sh-csv.1 @@ -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 a line containing no elements at all. |
