from yml

For formats.

Parse text as .yaml/.yml and create table.

Command Type

built-in

Signature

> from yml {flags}

Flags

  • --spec {string}: YAML spec version (‘1.1’ or ‘1.2’ (default)).
  • --multiple {string}: Handle multiple documents (‘auto’, ‘list’, ‘single’).
  • --ignore-tags: Ignore any tags
  • --key-resolution {string}: Handle plain scalar keys (‘strict’ (default), ‘verbatim’).

Input/output types:

input output
string any

Examples

Converts YAML formatted string to table.

> 'a: 1' | from yml
╭───┬───╮
│ a │ 1 │
╰───┴───╯

Converts YAML formatted string to table.

> '[ a: 1, b: [1, 2] ]' | from yml
╭───┬────┬───────────╮
│ # │ a  │     b     │
├───┼────┼───────────┤
│ 0 │  1 │    ❎     │
│ 1 │ ❎ │ ╭───┬───╮ │
│   │    │ │ 0 │ 1 │ │
│   │    │ │ 1 │ 2 │ │
│   │    │ ╰───┴───╯ │
╰───┴────┴───────────╯

Convert nushell values from YAML.

> '!cell-path $.1.abc?.def!' | from yml
$.1.abc?.def!

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.