Skip to content

Commit 5e7fde9

Browse files
authored
Document "line" output format (#5571)
1 parent 7b5a68b commit 5e7fde9

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

docs/commands/super.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ in the order appearing on the command line forming the input stream.
133133
| `csv` | yes | [Comma-Separated Values (RFC 4180)](https://www.rfc-editor.org/rfc/rfc4180.html) |
134134
| `json` | yes | [JSON (RFC 8259)](https://www.rfc-editor.org/rfc/rfc8259.html) |
135135
| `jsup` | yes | [Super JSON](../formats/jsup.md) |
136-
| `zjson` | yes | [Super JSON over JSON](../formats/zjson.md) |
137136
| `line` | no | One string value per input line |
138137
| `parquet` | yes | [Apache Parquet](https://github.com/apache/parquet-format) |
139138
| `tsv` | yes | [Tab-Separated Values](https://en.wikipedia.org/wiki/Tab-separated_values) |
140139
| `zeek` | yes | [Zeek Logs](https://docs.zeek.org/en/master/logs/index.html) |
140+
| `zjson` | yes | [Super JSON over JSON](../formats/zjson.md) |
141141

142142
The input format is typically [detected automatically](#auto-detection) and the formats for which
143143
"Auto" is "yes" in the table above support _auto-detection_.
@@ -217,13 +217,14 @@ typically omit quotes around field names.
217217
| `csv` | [Comma-Separated Values (RFC 4180)](https://www.rfc-editor.org/rfc/rfc4180.html) |
218218
| `json` | [JSON (RFC 8259)](https://www.rfc-editor.org/rfc/rfc8259.html) |
219219
| `jsup` | [Super JSON](../formats/jsup.md) |
220-
| `zjson` | [Super JSON over JSON](../formats/zjson.md) |
221220
| `lake` | [SuperDB Data Lake Metadata Output](#superdb-data-lake-metadata-output) |
221+
| `line` | (described [below](#simplified-text-outputs)) |
222222
| `parquet` | [Apache Parquet](https://github.com/apache/parquet-format) |
223223
| `table` | (described [below](#simplified-text-outputs)) |
224224
| `text` | (described [below](#simplified-text-outputs)) |
225225
| `tsv` | [Tab-Separated Values](https://en.wikipedia.org/wiki/Tab-separated_values) |
226226
| `zeek` | [Zeek Logs](https://docs.zeek.org/en/master/logs/index.html) |
227+
| `zjson` | [Super JSON over JSON](../formats/zjson.md) |
227228

228229
The output format defaults to either Super JSON or Super Binary and may be specified
229230
with the `-f` option.
@@ -399,12 +400,39 @@ be used with any output format.
399400

400401
#### Simplified Text Outputs
401402

402-
The `text` and `table` formats simplify data to fit within the
403-
limitations of text-based output. Because they do not capture all the
404-
information required to reconstruct the original data, they are not supported
405-
input formats. They may be a good fit for use with other text-based shell
403+
The `line`, `text`, and `table` formats simplify data to fit within the
404+
limitations of text-based output. They may be a good fit for use with other text-based shell
406405
tools, but due to their limitations should be used with care.
407406

407+
In `line` output, each string value is printed on its own line, with minimal
408+
formatting applied if any of the following escape sequences are present:
409+
410+
| Escape Sequence | Rendered As |
411+
|-----------------|-----------------------------------------|
412+
| `\n` | Newline |
413+
| `\t` | Horizontal tab |
414+
| `\\` | Backslash |
415+
| `\"` | Double quote |
416+
| `\r` | Carriage return |
417+
| `\b` | Backspace |
418+
| `\f` | Form feed |
419+
| `\u` | Unicode escape (e.g., `\u0041` for `A`) |
420+
421+
Non-string values are formatted as [Super JSON](../formats/jsup.md).
422+
423+
For example:
424+
425+
```mdtest-command
426+
echo '"hi" "hello\nworld" { time_elapsed: 86400s }' | super -f line -
427+
```
428+
produces
429+
```mdtest-output
430+
hi
431+
hello
432+
world
433+
{time_elapsed:1d}
434+
```
435+
408436
In `text` output, minimal formatting is applied, e.g., strings are shown
409437
without quotes and brackets are dropped from [arrays](../formats/zed.md#22-array)
410438
and [sets](../formats/zed.md#23-set). [Records](../formats/zed.md#21-record)

0 commit comments

Comments
 (0)