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

into record for conversions

Convert value to record.

Signature

> into record {flags}

Input/output types:

inputoutput
datetimerecord
durationrecord
list<any>record
recordrecord

Examples

Convert from one row table to record

> [[value]; [false]] | into record
╭───────┬───────╮
│ value │ false │
╰───────┴───────╯

Convert from list of records to record

> [{foo: bar} {baz: quux}] | into record
╭─────┬──────╮
│ foo │ bar  │
│ baz │ quux │
╰─────┴──────╯

Convert from list of pairs into record

> [[foo bar] [baz quux]] | into record
╭─────┬──────╮
│ foo │ bar  │
│ baz │ quux │
╰─────┴──────╯

convert duration to record (weeks max)

> (-500day - 4hr - 5sec) | into record
╭────────┬────╮
│ week   │ 71 │
│ day    │ 3  │
│ hour   │ 4  │
│ second │ 5  │
│ sign   │ -  │
╰────────┴────╯

convert record to record

> {a: 1, b: 2} | into record
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
╰───┴───╯

convert date to record

> 2020-04-12T22:10:57+02:00 | into record
╭─────────────┬────────╮
│ year        │ 2020   │
│ month       │ 4      │
│ day         │ 12     │
│ hour        │ 22     │
│ minute      │ 10     │
│ second      │ 57     │
│ millisecond │ 0      │
│ microsecond │ 0      │
│ nanosecond  │ 0      │
│ timezone    │ +02:00 │
╰─────────────┴────────╯

convert date components to table columns

> 2020-04-12T22:10:57+02:00 | into record | transpose | transpose -r