to txt

For formats.

Convert data into plain text format.

Command Type

built-in

Signature

> to txt {flags}

Flags

  • --no-newline, -n: Do not append a newline to the end of the text.
  • --serialize, -s: Serialize nushell types that cannot be deserialized.

Input/output types:

input output
any string

Examples

Outputs data as simple text with a trailing newline.

> [1] | to txt
1

Outputs data as simple text without a trailing newline.

> [1] | to txt --no-newline
1

Outputs external data as simple text.

> git help -a | lines | find -r '^ ' | to txt

Outputs records as simple text.

> ls | to txt

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