Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

to kdl for formats

Converts table data into KDL text.

Signature

> to kdl {flags}

Flags

  • --serialize, -s: Serialize nushell types that cannot be deserialized.

Input/output types:

inputoutput
anystring

Examples

Convert yaml file to kdl file

> {this: that list: [1 2 3 {bool: true} {this: should be: a-block}]} | to yaml | from yaml | to kdl
this that
list 1 2 3 bool=#true {
    this should
    be a-block
}

Convert nu record to kdl

> {one: [{one: two, 1: 2} {three: 3} [1 2 3] 4 5 6 {bool: true}] } | to kdl
one three=3 1 2 3 4 5 6 bool=#true {
    one two
    "1" 2
}

Convert nu list to kdl string

> [1 2 3] | to kdl
root 1 2 3

Convert nu closure to kdl string

> {2: {|| 1 + 1} } | to kdl --serialize
"2" "{|| 1 + 1}"

Round-trip KDL through canonical node rows.

> 'node one; node two' | from kdl | to kdl
node one
node two