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

from ini for formats

Parse text as .ini and create table.

Signature

> from ini {flags}

Flags

  • --no-quote, -q: Disable quote handling for values.
  • --no-escape, -e: Disable escape sequence handling for values.
  • --indented-multiline-value, -m: Allow values to continue on indented lines.
  • --preserve-key-leading-whitespace, -w: Preserve leading whitespace in keys.

Input/output types:

inputoutput
stringrecord

Examples

Converts ini formatted string to record

> '[foo]
a=1
b=2' | from ini
╭─────┬───────────╮
│     │ ╭───┬───╮ │
│ foo │ │ a │ 1 │ │
│     │ │ b │ 2 │ │
│     │ ╰───┴───╯ │
╰─────┴───────────╯

Disable escaping to keep backslashes literal

> '[start]
file=C:\Windows\System32\xcopy.exe' | from ini --no-escape
╭───────┬──────────────────────────────────────────╮
│       │ ╭──────┬───────────────────────────────╮ │
│ start │ │ file │ C:\Windows\System32\xcopy.exe │ │
│       │ ╰──────┴───────────────────────────────╯ │
╰───────┴──────────────────────────────────────────╯

Disable quote handling to keep quote characters

> '[foo]
bar="quoted"' | from ini --no-quote
╭─────┬────────────────────╮
│     │ ╭─────┬──────────╮ │
│ foo │ │ bar │ "quoted" │ │
│     │ ╰─────┴──────────╯ │
╰─────┴────────────────────╯

Allow values to continue on indented lines

> '[foo]
bar=line one
  line two' | from ini --indented-multiline-value
╭─────┬────────────────────╮
│     │ ╭─────┬──────────╮ │
│ foo │ │ bar │ line one │ │
│     │ │     │ line two │ │
│     │ ╰─────┴──────────╯ │
╰─────┴────────────────────╯

Preserve leading whitespace in keys

> '[foo]
  key=value' | from ini --preserve-key-leading-whitespace
╭─────┬───────────────────╮
│     │ ╭───────┬───────╮ │
│ foo │ │   key │ value │ │
│     │ ╰───────┴───────╯ │
╰─────┴───────────────────╯