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

open for filesystem

Load a file into a cell, converting to table if possible (avoid by appending '--raw').

Signature

> open {flags} ...rest

Flags

  • --raw, -r: open file as raw binary

Parameters

  • ...rest: The file(s) to open.

Input/output types:

inputoutput
anyany
nothingany
stringany

Examples

Open a file, with structure (based on file extension or SQLite database header)

> open myfile.json

Open a file, as raw bytes

> open myfile.json --raw

Open a file, using the input to get filename

> 'myfile.txt' | open

Open a file, and decode it by the specified encoding

> open myfile.txt --raw | decode utf-8

Create a custom from parser to open newline-delimited JSON files with open

> def "from ndjson" [] { from json -o }; open myfile.ndjson

Notes

Support to automatically parse files with an extension .xyz can be provided by a from xyz command in scope.