Conversions
fill— Fill and align text in columns.format bits— Convert value to a string of binary data represented by 0 and 1.format number— Format a number.into— Commands to convert data from one type to another.into binary— Convert value to a binary primitive.into bool— Convert value to a boolean.into cell-path— Convert value to a cell-path.into datetime— Convert text or timestamp into a datetime.into duration— Convert value to a duration.into filesize— Convert value to a filesize.into float— Convert data into floating point number.into glob— Convert value to a glob pattern.into int— Convert value to an integer.into matrix— Convert a nushell table or list of lists into a matrix.into record— Convert value to a record.into semver— Convert a value (string, record, or semver) to a semantic version.into semver-range— Convert a string to a semver range.into sqlite— Convert table into a SQLite database.into string— Convert value to a string.into value— Convert custom values into base values.matrix into-nu— Convert a matrix to a nushell table (list of lists by default).split cell-path— Split a cell-path into its components.
Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.
Tips
Intro
into string turns a number into text.
1 | into string
into int turns digits into a number.
"3" | into int
Basic
into string and into int round-trip a number.
1 | into string | into int
into float and math round meet at an integer.
4 | into float | math round
Intermediate
Text, a count, then text again.
12 | into string | str length | into string
Convert each number inside a closure.
[1 2] | each {|n| $n | into string} | length
Advanced
Four conversions from a number to a count.
12 | into string | str length | into string | str length