diff --git a/docs/commands/alias.md b/docs/commands/alias.md deleted file mode 100644 index 70aaf1c1fe..0000000000 --- a/docs/commands/alias.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: alias -layout: command -version: 0.59.1 ---- - -Alias a command (with optional flags) to a new name - -## Signature - -```> alias (name) (initial_value)``` - -## Parameters - - - `name`: name of the alias - - `initial_value`: equals sign followed by value - -## Examples - -Alias ll to ls -l -```shell -> alias ll = ls -l -``` diff --git a/docs/commands/all.md b/docs/commands/all.md deleted file mode 100644 index 58db4a6e77..0000000000 --- a/docs/commands/all.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: all? -layout: command -version: 0.59.1 ---- - -Test if every element of the input matches a predicate. - -## Signature - -```> all? (predicate)``` - -## Parameters - - - `predicate`: the predicate that must match - -## Examples - -Find if services are running -```shell -> echo [[status]; [UP] [UP]] | all? status == UP -``` - -Check that all values are even -```shell -> echo [2 4 6 8] | all? ($it mod 2) == 0 -``` diff --git a/docs/commands/ansi.md b/docs/commands/ansi.md deleted file mode 100644 index 57301990aa..0000000000 --- a/docs/commands/ansi.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: ansi -layout: command -version: 0.59.1 ---- - -Output ANSI codes to change color. - -## Signature - -```> ansi (code) --escape --osc --list``` - -## Parameters - - - `code`: the name of the code to use like 'green' or 'reset' to reset the color - - `--escape`: escape sequence without the escape character(s) - - `--osc`: operating system command (ocs) escape sequence without the escape character(s) - - `--list`: list available ansi code names - -## Examples - -Change color to green -```shell -> ansi green -``` - -Reset the color -```shell -> ansi reset -``` - -Use ansi to color text (rb = red bold, gb = green bold, pb = purple bold) -```shell -> echo [(ansi rb) Hello " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect -``` - -Use ansi to color text (italic bright yellow on red 'Hello' with green bold 'Nu' and purple bold 'World') -```shell -> echo [(ansi -e '3;93;41m') Hello (ansi reset) " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect -``` - -Use ansi to color text with a style (blue on red in bold) -```shell -> $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)" -``` diff --git a/docs/commands/ansi_gradient.md b/docs/commands/ansi_gradient.md deleted file mode 100644 index f00f546f09..0000000000 --- a/docs/commands/ansi_gradient.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: ansi gradient -layout: command -version: 0.59.1 ---- - -draw text with a provided start and end code making a gradient - -## Signature - -```> ansi gradient ...column path --fgstart --fgend --bgstart --bgend``` - -## Parameters - - - `...column path`: optionally, draw gradients using text from column paths - - `--fgstart {string}`: foreground gradient start color in hex (0x123456) - - `--fgend {string}`: foreground gradient end color in hex - - `--bgstart {string}`: background gradient start color in hex - - `--bgend {string}`: background gradient end color in hex - -## Examples - -draw text in a gradient with foreground start and end colors -```shell -> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff -``` - -draw text in a gradient with foreground start and end colors and background start and end colors -```shell -> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff --bgstart 0xe81cff --bgend 0x40c9ff -``` - -draw text in a gradient by specifying foreground start color - end color is assumed to be black -```shell -> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff -``` - -draw text in a gradient by specifying foreground end color - start color is assumed to be black -```shell -> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff -``` diff --git a/docs/commands/ansi_strip.md b/docs/commands/ansi_strip.md deleted file mode 100644 index c45e2f836f..0000000000 --- a/docs/commands/ansi_strip.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: ansi strip -layout: command -version: 0.59.1 ---- - -strip ansi escape sequences from string - -## Signature - -```> ansi strip ...column path``` - -## Parameters - - - `...column path`: optionally, remove ansi sequences by column paths - -## Examples - -strip ansi escape sequences from string -```shell -> echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip -``` diff --git a/docs/commands/any.md b/docs/commands/any.md deleted file mode 100644 index 04e9add15b..0000000000 --- a/docs/commands/any.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: any? -layout: command -version: 0.59.1 ---- - -Tests if any element of the input matches a predicate. - -## Signature - -```> any? (predicate)``` - -## Parameters - - - `predicate`: the predicate that must match - -## Examples - -Find if a service is not running -```shell -> echo [[status]; [UP] [DOWN] [UP]] | any? status == DOWN -``` - -Check if any of the values is odd -```shell -> echo [2 4 1 6 8] | any? ($it mod 2) == 1 -``` diff --git a/docs/commands/append.md b/docs/commands/append.md deleted file mode 100644 index 977bbbda77..0000000000 --- a/docs/commands/append.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: append -layout: command -version: 0.59.1 ---- - -Append a row to the table. - -## Signature - -```> append (row)``` - -## Parameters - - - `row`: the row to append - -## Examples - -Append one Int item -```shell -> [0,1,2,3] | append 4 -``` - -Append three Int items -```shell -> [0,1] | append [2,3,4] -``` - -Append Ints and Strings -```shell -> [0,1] | append [2,nu,4,shell] -``` diff --git a/docs/commands/benchmark.md b/docs/commands/benchmark.md deleted file mode 100644 index 1f5d7e995a..0000000000 --- a/docs/commands/benchmark.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: benchmark -layout: command -version: 0.59.1 ---- - -Time the running time of a block - -## Signature - -```> benchmark (block)``` - -## Parameters - - - `block`: the block to run - -## Examples - -Benchmarks a command within a block -```shell -> benchmark { sleep 500ms } -``` diff --git a/docs/commands/build-string.md b/docs/commands/build-string.md deleted file mode 100644 index d67cec9b90..0000000000 --- a/docs/commands/build-string.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: build-string -layout: command -version: 0.59.1 ---- - -Create a string from the arguments. - -## Signature - -```> build-string ...rest``` - -## Parameters - - - `...rest`: list of string - -## Examples - -Builds a string from letters a b c -```shell -> build-string a b c -``` - -Builds a string from letters a b c -```shell -> build-string (1 + 2) = one ' ' plus ' ' two -``` diff --git a/docs/commands/cal.md b/docs/commands/cal.md deleted file mode 100644 index de57e37003..0000000000 --- a/docs/commands/cal.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: cal -layout: command -version: 0.59.1 ---- - -Display a calendar. - -## Signature - -```> cal --year --quarter --month --full-year --week-start --month-names``` - -## Parameters - - - `--year`: Display the year column - - `--quarter`: Display the quarter column - - `--month`: Display the month column - - `--full-year {int}`: Display a year-long calendar for the specified year - - `--week-start {string}`: Display the calendar with the specified day as the first day of the week - - `--month-names`: Display the month names instead of integers - -## Examples - -This month's calendar -```shell -> cal -``` - -The calendar for all of 2012 -```shell -> cal --full-year 2012 -``` - -This month's calendar with the week starting on monday -```shell -> cal --week-start monday -``` diff --git a/docs/commands/cd.md b/docs/commands/cd.md deleted file mode 100644 index b8d537c914..0000000000 --- a/docs/commands/cd.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: cd -layout: command -version: 0.59.1 ---- - -Change directory. - -## Signature - -```> cd (path)``` - -## Parameters - - - `path`: the path to change to - -## Examples - -Change to your home directory -```shell -> cd ~ -``` diff --git a/docs/commands/char.md b/docs/commands/char.md deleted file mode 100644 index 21a6151271..0000000000 --- a/docs/commands/char.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: char -layout: command -version: 0.59.1 ---- - -Output special characters (e.g., 'newline'). - -## Signature - -```> char (character) ...rest --list --unicode``` - -## Parameters - - - `character`: the name of the character to output - - `...rest`: multiple Unicode bytes - - `--list`: List all supported character names - - `--unicode`: Unicode string i.e. 1f378 - -## Examples - -Output newline -```shell -> char newline -``` - -Output prompt character, newline and a hamburger character -```shell -> echo [(char prompt) (char newline) (char hamburger)] | str collect -``` - -Output Unicode character -```shell -> char -u 1f378 -``` - -Output multi-byte Unicode character -```shell -> char -u 1F468 200D 1F466 200D 1F466 -``` diff --git a/docs/commands/clear.md b/docs/commands/clear.md deleted file mode 100644 index 23781f8f97..0000000000 --- a/docs/commands/clear.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: clear -layout: command -version: 0.59.1 ---- - -Clear the terminal. - -## Signature - -```> clear ``` - -## Examples - -Clear the terminal -```shell -> clear -``` diff --git a/docs/commands/collect.md b/docs/commands/collect.md deleted file mode 100644 index c195319b35..0000000000 --- a/docs/commands/collect.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: collect -layout: command -version: 0.59.1 ---- - -Collect the stream and pass it to a block. - -## Signature - -```> collect (block)``` - -## Parameters - - - `block`: the block to run once the stream is collected - -## Examples - -Use the second value in the stream -```shell -> echo 1 2 3 | collect { |x| echo $x.1 } -``` diff --git a/docs/commands/columns.md b/docs/commands/columns.md deleted file mode 100644 index 66291bdba1..0000000000 --- a/docs/commands/columns.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: columns -layout: command -version: 0.59.1 ---- - -Show the columns in the input. - -## Signature - -```> columns ``` - -## Examples - -Get the columns from the table -```shell -> [[name,age,grade]; [bill,20,a]] | columns -``` - -Get the first column from the table -```shell -> [[name,age,grade]; [bill,20,a]] | columns | first -``` - -Get the second column from the table -```shell -> [[name,age,grade]; [bill,20,a]] | columns | select 1 -``` diff --git a/docs/commands/compact.md b/docs/commands/compact.md deleted file mode 100644 index 0507a44be5..0000000000 --- a/docs/commands/compact.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: compact -layout: command -version: 0.59.1 ---- - -Creates a table with non-empty rows. - -## Signature - -```> compact ...columns``` - -## Parameters - - - `...columns`: the columns to compact from the table - -## Examples - -Filter out all records where 'Hello' is null (returns nothing) -```shell -> echo [["Hello" "World"]; [$nothing 3]]| compact Hello -``` - -Filter out all records where 'World' is null (Returns the table) -```shell -> echo [["Hello" "World"]; [$nothing 3]]| compact World -``` - -Filter out all instances of nothing from a list (Returns [1,2]) -```shell -> echo [1, $nothing, 2] | compact -``` diff --git a/docs/commands/complete.md b/docs/commands/complete.md deleted file mode 100644 index 20beb3c344..0000000000 --- a/docs/commands/complete.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: complete -layout: command -version: 0.59.1 ---- - -Complete the external piped in, collecting outputs and exit code - -## Signature - -```> complete ``` - -## Examples - -Run the external completion -```shell -> ^external arg1 | complete -``` diff --git a/docs/commands/cp.md b/docs/commands/cp.md deleted file mode 100644 index 8872f9da0d..0000000000 --- a/docs/commands/cp.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: cp -layout: command -version: 0.59.1 ---- - -Copy files. - -## Signature - -```> cp (source) (destination) --recursive``` - -## Parameters - - - `source`: the place to copy from - - `destination`: the place to copy to - - `--recursive`: copy recursively through subdirectories - -## Examples - -Copy myfile to dir_b -```shell -> cp myfile dir_b -``` - -Recursively copy dir_a to dir_b -```shell -> cp -r dir_a dir_b -``` diff --git a/docs/commands/dataframe.md b/docs/commands/dataframe.md deleted file mode 100644 index e54637d8a5..0000000000 --- a/docs/commands/dataframe.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: dataframe -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> dataframe ``` diff --git a/docs/commands/date.md b/docs/commands/date.md deleted file mode 100644 index 685fa42ca2..0000000000 --- a/docs/commands/date.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: date -layout: command -version: 0.59.1 ---- - -date - -## Signature - -```> date ``` diff --git a/docs/commands/date_format.md b/docs/commands/date_format.md deleted file mode 100644 index b0cb64f690..0000000000 --- a/docs/commands/date_format.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: date format -layout: command -version: 0.59.1 ---- - -Format a given date using a format string. - -## Signature - -```> date format (format string) --list``` - -## Parameters - - - `format string`: the desired date format - - `--list`: lists strftime cheatsheet - -## Examples - -Format a given date using the default format (RFC 2822). -```shell -> "2021-10-22 20:00:12 +01:00" | date format -``` - -Format a given date using a given format string. -```shell -> date format '%Y-%m-%d' -``` - -Format a given date using a given format string. -```shell -> date format "%Y-%m-%d %H:%M:%S" -``` - -Format a given date using a given format string. -```shell -> "2021-10-22 20:00:12 +01:00" | date format "%Y-%m-%d" -``` diff --git a/docs/commands/date_humanize.md b/docs/commands/date_humanize.md deleted file mode 100644 index e36fa5e647..0000000000 --- a/docs/commands/date_humanize.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: date humanize -layout: command -version: 0.59.1 ---- - -Print a 'humanized' format for the date, relative to now. - -## Signature - -```> date humanize ``` - -## Examples - -Print a 'humanized' format for the date, relative to now. -```shell -> date humanize -``` - -Print a 'humanized' format for the date, relative to now. -```shell -> "2021-10-22 20:00:12 +01:00" | date humanize -``` diff --git a/docs/commands/date_list-timezone.md b/docs/commands/date_list-timezone.md deleted file mode 100644 index 0d9d9624f0..0000000000 --- a/docs/commands/date_list-timezone.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: date list-timezone -layout: command -version: 0.59.1 ---- - -List supported time zones. - -## Signature - -```> date list-timezone ``` - -## Examples - -Show timezone(s) that contains 'Shanghai' -```shell -> date list-timezone | where timezone =~ Shanghai -``` diff --git a/docs/commands/date_now.md b/docs/commands/date_now.md deleted file mode 100644 index 50b960ebc0..0000000000 --- a/docs/commands/date_now.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: date now -layout: command -version: 0.59.1 ---- - -Get the current date. - -## Signature - -```> date now ``` - -## Examples - -Get the current date and display it in a given format string. -```shell -> date now | date format "%Y-%m-%d %H:%M:%S" -``` - -Get the time duration from 2019-04-30 to now -```shell -> (date now) - 2019-05-01 -``` - -Get the time duration since a more accurate time -```shell -> (date now) - 2019-05-01T04:12:05.20+08:00 -``` - -Get current time in full RFC3339 format with timezone -```shell -> date now | debug -``` diff --git a/docs/commands/date_to-table.md b/docs/commands/date_to-table.md deleted file mode 100644 index 3c0d71a8ac..0000000000 --- a/docs/commands/date_to-table.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: date to-table -layout: command -version: 0.59.1 ---- - -Print the date in a structured table. - -## Signature - -```> date to-table ``` - -## Examples - -Print the date in a structured table. -```shell -> date to-table -``` - -Print the date in a structured table. -```shell -> date now | date to-table -``` - -Print the date in a structured table. -```shell -> '2020-04-12 22:10:57 +0200' | date to-table -``` diff --git a/docs/commands/date_to-timezone.md b/docs/commands/date_to-timezone.md deleted file mode 100644 index 3c24d8c3b4..0000000000 --- a/docs/commands/date_to-timezone.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: date to-timezone -layout: command -version: 0.59.1 ---- - -Convert a date to a given time zone. - -## Signature - -```> date to-timezone (time zone)``` - -## Parameters - - - `time zone`: time zone description - -## Examples - -Get the current date in UTC+05:00 -```shell -> date now | date to-timezone +0500 -``` - -Get the current local date -```shell -> date now | date to-timezone local -``` - -Get the current date in Hawaii -```shell -> date now | date to-timezone US/Hawaii -``` - -Get the current date in Hawaii -```shell -> "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500" -``` diff --git a/docs/commands/debug.md b/docs/commands/debug.md deleted file mode 100644 index 83555b3d47..0000000000 --- a/docs/commands/debug.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: debug -layout: command -version: 0.59.1 ---- - -Debug print the value(s) piped in. - -## Signature - -```> debug --raw``` - -## Parameters - - - `--raw`: Prints the raw value representation - -## Examples - -Print the value of a string -```shell -> 'hello' | debug -``` - -Print the value of a table -```shell -> echo [[version patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | debug -``` diff --git a/docs/commands/decode.md b/docs/commands/decode.md deleted file mode 100644 index 43a88fab53..0000000000 --- a/docs/commands/decode.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: decode -layout: command -version: 0.59.1 ---- - -Decode bytes as a string. - -## Signature - -```> decode (encoding)``` - -## Parameters - - - `encoding`: the text encoding to use - -## Examples - -Decode the output of an external command -```shell -> cat myfile.q | decode utf-8 -``` diff --git a/docs/commands/def-env.md b/docs/commands/def-env.md deleted file mode 100644 index d0a9fce4cb..0000000000 --- a/docs/commands/def-env.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: def-env -layout: command -version: 0.59.1 ---- - -Define a custom command, which participates in the caller environment - -## Signature - -```> def-env (def_name) (params) (block)``` - -## Parameters - - - `def_name`: definition name - - `params`: parameters - - `block`: body of the definition - -## Examples - -Set environment variable by call a custom command -```shell -> def-env foo [] { let-env BAR = "BAZ" }; foo; $env.BAR -``` diff --git a/docs/commands/def.md b/docs/commands/def.md deleted file mode 100644 index 454e1fabba..0000000000 --- a/docs/commands/def.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: def -layout: command -version: 0.59.1 ---- - -Define a custom command - -## Signature - -```> def (def_name) (params) (block)``` - -## Parameters - - - `def_name`: definition name - - `params`: parameters - - `block`: body of the definition - -## Examples - -Define a command and run it -```shell -> def say-hi [] { echo 'hi' }; say-hi -``` - -Define a command and run it with parameter(s) -```shell -> def say-sth [sth: string] { echo $sth }; say-sth hi -``` diff --git a/docs/commands/default.md b/docs/commands/default.md deleted file mode 100644 index 2d9559b5bf..0000000000 --- a/docs/commands/default.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: default -layout: command -version: 0.59.1 ---- - -Sets a default row's column if missing. - -## Signature - -```> default (default value) (column name)``` - -## Parameters - - - `default value`: the value to use as a default - - `column name`: the name of the column - -## Examples - -Give a default 'target' column to all file entries -```shell -> ls -la | default 'nothing' target -``` - -Default the `$nothing` value in a list -```shell -> [1, 2, $nothing, 4] | default 3 -``` diff --git a/docs/commands/describe.md b/docs/commands/describe.md deleted file mode 100644 index aebbbb9f19..0000000000 --- a/docs/commands/describe.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: describe -layout: command -version: 0.59.1 ---- - -Describe the value(s) piped in. - -## Signature - -```> describe ``` - -## Examples - -Describe the type of a string -```shell -> 'hello' | describe -``` diff --git a/docs/commands/detect_columns.md b/docs/commands/detect_columns.md deleted file mode 100644 index 5a1f42932a..0000000000 --- a/docs/commands/detect_columns.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: detect columns -layout: command -version: 0.59.1 ---- - -splits contents across multiple columns via the separator. - -## Signature - -```> detect columns --skip --no-headers``` - -## Parameters - - - `--skip {int}`: number of rows to skip before detecting - - `--no-headers`: don't detect headers - -## Examples - -Splits string across multiple columns -```shell -> echo 'a b c' | detect columns -n -``` - -Splits a multi-line string into columns with headers detected -```shell -> echo $'c1 c2 c3(char nl)a b c' | detect columns -``` diff --git a/docs/commands/dfr.md b/docs/commands/dfr.md deleted file mode 100644 index 18f1555712..0000000000 --- a/docs/commands/dfr.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: dfr -layout: command -version: 0.59.1 ---- - -Dataframe commands - -## Signature - -```> dfr ``` diff --git a/docs/commands/dfr_aggregate.md b/docs/commands/dfr_aggregate.md deleted file mode 100644 index 0615c6ca74..0000000000 --- a/docs/commands/dfr_aggregate.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: dfr aggregate -layout: command -version: 0.59.1 ---- - -Performs an aggregation operation on a dataframe and groupby object - -## Signature - -```> dfr aggregate (operation_name) --quantile --explicit``` - -## Parameters - - - `operation_name`: - Dataframes: mean, sum, min, max, quantile, median, var, std - GroupBy: mean, sum, min, max, first, last, nunique, quantile, median, var, std, count - - `--quantile {number}`: quantile value for quantile operation - - `--explicit`: returns explicit names for groupby aggregations - -## Examples - -Aggregate sum by grouping by column a and summing on col b -```shell -> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a | dfr aggregate sum -``` - -Aggregate sum in dataframe columns -```shell -> [[a b]; [4 1] [5 2]] | dfr to-df | dfr aggregate sum -``` - -Aggregate sum in series -```shell -> [4 1 5 6] | dfr to-df | dfr aggregate sum -``` diff --git a/docs/commands/dfr_all-false.md b/docs/commands/dfr_all-false.md deleted file mode 100644 index 6d38130e8d..0000000000 --- a/docs/commands/dfr_all-false.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: dfr all-false -layout: command -version: 0.59.1 ---- - -Returns true if all values are false - -## Signature - -```> dfr all-false ``` - -## Examples - -Returns true if all values are false -```shell -> [false false false] | dfr to-df | dfr all-false -``` - -Checks the result from a comparison -```shell -> let s = ([5 6 2 10] | dfr to-df); - let res = ($s > 9); - $res | dfr all-false -``` diff --git a/docs/commands/dfr_all-true.md b/docs/commands/dfr_all-true.md deleted file mode 100644 index 6c8f3e6af4..0000000000 --- a/docs/commands/dfr_all-true.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: dfr all-true -layout: command -version: 0.59.1 ---- - -Returns true if all values are true - -## Signature - -```> dfr all-true ``` - -## Examples - -Returns true if all values are true -```shell -> [true true true] | dfr to-df | dfr all-true -``` - -Checks the result from a comparison -```shell -> let s = ([5 6 2 8] | dfr to-df); - let res = ($s > 9); - $res | dfr all-true -``` diff --git a/docs/commands/dfr_append.md b/docs/commands/dfr_append.md deleted file mode 100644 index 0329fda0f6..0000000000 --- a/docs/commands/dfr_append.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: dfr append -layout: command -version: 0.59.1 ---- - -Appends a new dataframe - -## Signature - -```> dfr append (other) --col``` - -## Parameters - - - `other`: dataframe to be appended - - `--col`: appends in col orientation - -## Examples - -Appends a dataframe as new columns -```shell -> let a = ([[a b]; [1 2] [3 4]] | dfr to-df); - $a | dfr append $a -``` - -Appends a dataframe merging at the end of columns -```shell -> let a = ([[a b]; [1 2] [3 4]] | dfr to-df); - $a | dfr append $a --col -``` diff --git a/docs/commands/dfr_arg-max.md b/docs/commands/dfr_arg-max.md deleted file mode 100644 index 1ea08e9593..0000000000 --- a/docs/commands/dfr_arg-max.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr arg-max -layout: command -version: 0.59.1 ---- - -Return index for max value in series - -## Signature - -```> dfr arg-max ``` - -## Examples - -Returns index for max value -```shell -> [1 3 2] | dfr to-df | dfr arg-max -``` diff --git a/docs/commands/dfr_arg-min.md b/docs/commands/dfr_arg-min.md deleted file mode 100644 index 15e6bbb7b8..0000000000 --- a/docs/commands/dfr_arg-min.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr arg-min -layout: command -version: 0.59.1 ---- - -Return index for min value in series - -## Signature - -```> dfr arg-min ``` - -## Examples - -Returns index for min value -```shell -> [1 3 2] | dfr to-df | dfr arg-min -``` diff --git a/docs/commands/dfr_arg-sort.md b/docs/commands/dfr_arg-sort.md deleted file mode 100644 index c86820bdb8..0000000000 --- a/docs/commands/dfr_arg-sort.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: dfr arg-sort -layout: command -version: 0.59.1 ---- - -Returns indexes for a sorted series - -## Signature - -```> dfr arg-sort --reverse``` - -## Parameters - - - `--reverse`: reverse order - -## Examples - -Returns indexes for a sorted series -```shell -> [1 2 2 3 3] | dfr to-df | dfr arg-sort -``` - -Returns indexes for a sorted series -```shell -> [1 2 2 3 3] | dfr to-df | dfr arg-sort -r -``` diff --git a/docs/commands/dfr_arg-true.md b/docs/commands/dfr_arg-true.md deleted file mode 100644 index bc0d8ae85b..0000000000 --- a/docs/commands/dfr_arg-true.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr arg-true -layout: command -version: 0.59.1 ---- - -Returns indexes where values are true - -## Signature - -```> dfr arg-true ``` - -## Examples - -Returns indexes where values are true -```shell -> [false true false] | dfr to-df | dfr arg-true -``` diff --git a/docs/commands/dfr_arg-unique.md b/docs/commands/dfr_arg-unique.md deleted file mode 100644 index 870c3bd4ba..0000000000 --- a/docs/commands/dfr_arg-unique.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr arg-unique -layout: command -version: 0.59.1 ---- - -Returns indexes for unique values - -## Signature - -```> dfr arg-unique ``` - -## Examples - -Returns indexes for unique values -```shell -> [1 2 2 3 3] | dfr to-df | dfr arg-unique -``` diff --git a/docs/commands/dfr_column.md b/docs/commands/dfr_column.md deleted file mode 100644 index 0084c0d91a..0000000000 --- a/docs/commands/dfr_column.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr column -layout: command -version: 0.59.1 ---- - -Returns the selected column - -## Signature - -```> dfr column (column)``` - -## Parameters - - - `column`: column name - -## Examples - -Returns the selected column as series -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr column a -``` diff --git a/docs/commands/dfr_concatenate.md b/docs/commands/dfr_concatenate.md deleted file mode 100644 index 2bc94323bf..0000000000 --- a/docs/commands/dfr_concatenate.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr concatenate -layout: command -version: 0.59.1 ---- - -Concatenates strings with other array - -## Signature - -```> dfr concatenate (other)``` - -## Parameters - - - `other`: Other array with string to be concatenated - -## Examples - -Concatenate string -```shell -> let other = ([za xs cd] | dfr to-df); - [abc abc abc] | dfr to-df | dfr concatenate $other -``` diff --git a/docs/commands/dfr_contains.md b/docs/commands/dfr_contains.md deleted file mode 100644 index 7e68519a8d..0000000000 --- a/docs/commands/dfr_contains.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr contains -layout: command -version: 0.59.1 ---- - -Checks if a pattern is contained in a string - -## Signature - -```> dfr contains (pattern)``` - -## Parameters - - - `pattern`: Regex pattern to be searched - -## Examples - -Returns boolean indicating if pattern was found -```shell -> [abc acb acb] | dfr to-df | dfr contains ab -``` diff --git a/docs/commands/dfr_count-null.md b/docs/commands/dfr_count-null.md deleted file mode 100644 index 45650a0644..0000000000 --- a/docs/commands/dfr_count-null.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: dfr count-null -layout: command -version: 0.59.1 ---- - -Counts null values - -## Signature - -```> dfr count-null ``` - -## Examples - -Counts null values -```shell -> let s = ([1 1 0 0 3 3 4] | dfr to-df); - ($s / $s) | dfr count-null -``` diff --git a/docs/commands/dfr_count-unique.md b/docs/commands/dfr_count-unique.md deleted file mode 100644 index 92d54054ab..0000000000 --- a/docs/commands/dfr_count-unique.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr count-unique -layout: command -version: 0.59.1 ---- - -Counts unique values - -## Signature - -```> dfr count-unique ``` - -## Examples - -Counts unique values -```shell -> [1 1 2 2 3 3 4] | dfr to-df | dfr count-unique -``` diff --git a/docs/commands/dfr_cumulative.md b/docs/commands/dfr_cumulative.md deleted file mode 100644 index 3aa2264f06..0000000000 --- a/docs/commands/dfr_cumulative.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr cumulative -layout: command -version: 0.59.1 ---- - -Cumulative calculation for a series - -## Signature - -```> dfr cumulative (type) --reverse``` - -## Parameters - - - `type`: rolling operation - - `--reverse`: Reverse cumulative calculation - -## Examples - -Cumulative sum for a series -```shell -> [1 2 3 4 5] | dfr to-df | dfr cumulative sum -``` diff --git a/docs/commands/dfr_describe.md b/docs/commands/dfr_describe.md deleted file mode 100644 index e98e830909..0000000000 --- a/docs/commands/dfr_describe.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr describe -layout: command -version: 0.59.1 ---- - -Describes dataframes numeric columns - -## Signature - -```> dfr describe --quantiles``` - -## Parameters - - - `--quantiles {table}`: optional quantiles for describe - -## Examples - -dataframe description -```shell -> [[a b]; [1 1] [1 1]] | dfr to-df | dfr describe -``` diff --git a/docs/commands/dfr_drop-duplicates.md b/docs/commands/dfr_drop-duplicates.md deleted file mode 100644 index c23d0962c8..0000000000 --- a/docs/commands/dfr_drop-duplicates.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr drop-duplicates -layout: command -version: 0.59.1 ---- - -Drops duplicate values in dataframe - -## Signature - -```> dfr drop-duplicates (subset) --maintain``` - -## Parameters - - - `subset`: subset of columns to drop duplicates - - `--maintain`: maintain order - -## Examples - -drop duplicates -```shell -> [[a b]; [1 2] [3 4] [1 2]] | dfr to-df | dfr drop-duplicates -``` diff --git a/docs/commands/dfr_drop-nulls.md b/docs/commands/dfr_drop-nulls.md deleted file mode 100644 index 8380400ec3..0000000000 --- a/docs/commands/dfr_drop-nulls.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: dfr drop-nulls -layout: command -version: 0.59.1 ---- - -Drops null values in dataframe - -## Signature - -```> dfr drop-nulls (subset)``` - -## Parameters - - - `subset`: subset of columns to drop nulls - -## Examples - -drop null values in dataframe -```shell -> let df = ([[a b]; [1 2] [3 0] [1 2]] | dfr to-df); - let res = ($df.b / $df.b); - let a = ($df | dfr with-column $res --name res); - $a | dfr drop-nulls -``` - -drop null values in dataframe -```shell -> let s = ([1 2 0 0 3 4] | dfr to-df); - ($s / $s) | dfr drop-nulls -``` diff --git a/docs/commands/dfr_drop.md b/docs/commands/dfr_drop.md deleted file mode 100644 index f582b72875..0000000000 --- a/docs/commands/dfr_drop.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr drop -layout: command -version: 0.59.1 ---- - -Creates a new dataframe by dropping the selected columns - -## Signature - -```> dfr drop ...rest``` - -## Parameters - - - `...rest`: column names to be dropped - -## Examples - -drop column a -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a -``` diff --git a/docs/commands/dfr_dtypes.md b/docs/commands/dfr_dtypes.md deleted file mode 100644 index 777fdc9a0f..0000000000 --- a/docs/commands/dfr_dtypes.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr dtypes -layout: command -version: 0.59.1 ---- - -Show dataframe data types - -## Signature - -```> dfr dtypes ``` - -## Examples - -Dataframe dtypes -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr dtypes -``` diff --git a/docs/commands/dfr_filter-with.md b/docs/commands/dfr_filter-with.md deleted file mode 100644 index e947d4c64f..0000000000 --- a/docs/commands/dfr_filter-with.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr filter-with -layout: command -version: 0.59.1 ---- - -Filters dataframe using a mask as reference - -## Signature - -```> dfr filter-with (mask)``` - -## Parameters - - - `mask`: boolean mask used to filter data - -## Examples - -Filter dataframe using a bool mask -```shell -> let mask = ([true false] | dfr to-df); - [[a b]; [1 2] [3 4]] | dfr to-df | dfr filter-with $mask -``` diff --git a/docs/commands/dfr_first.md b/docs/commands/dfr_first.md deleted file mode 100644 index 2439e9524f..0000000000 --- a/docs/commands/dfr_first.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr first -layout: command -version: 0.59.1 ---- - -Creates new dataframe with first rows - -## Signature - -```> dfr first (rows)``` - -## Parameters - - - `rows`: Number of rows for head - -## Examples - -Create new dataframe with head rows -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr first 1 -``` diff --git a/docs/commands/dfr_get-day.md b/docs/commands/dfr_get-day.md deleted file mode 100644 index 2378cc37a7..0000000000 --- a/docs/commands/dfr_get-day.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-day -layout: command -version: 0.59.1 ---- - -Gets day from date - -## Signature - -```> dfr get-day ``` - -## Examples - -Returns day from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-day -``` diff --git a/docs/commands/dfr_get-hour.md b/docs/commands/dfr_get-hour.md deleted file mode 100644 index 6b027c4ee6..0000000000 --- a/docs/commands/dfr_get-hour.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-hour -layout: command -version: 0.59.1 ---- - -Gets hour from date - -## Signature - -```> dfr get-hour ``` - -## Examples - -Returns hour from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-hour -``` diff --git a/docs/commands/dfr_get-minute.md b/docs/commands/dfr_get-minute.md deleted file mode 100644 index bb29281b5d..0000000000 --- a/docs/commands/dfr_get-minute.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-minute -layout: command -version: 0.59.1 ---- - -Gets minute from date - -## Signature - -```> dfr get-minute ``` - -## Examples - -Returns minute from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-minute -``` diff --git a/docs/commands/dfr_get-month.md b/docs/commands/dfr_get-month.md deleted file mode 100644 index b9136cba70..0000000000 --- a/docs/commands/dfr_get-month.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-month -layout: command -version: 0.59.1 ---- - -Gets month from date - -## Signature - -```> dfr get-month ``` - -## Examples - -Returns month from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-month -``` diff --git a/docs/commands/dfr_get-nanosecond.md b/docs/commands/dfr_get-nanosecond.md deleted file mode 100644 index 84fd05b415..0000000000 --- a/docs/commands/dfr_get-nanosecond.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-nanosecond -layout: command -version: 0.59.1 ---- - -Gets nanosecond from date - -## Signature - -```> dfr get-nanosecond ``` - -## Examples - -Returns nanosecond from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-nanosecond -``` diff --git a/docs/commands/dfr_get-ordinal.md b/docs/commands/dfr_get-ordinal.md deleted file mode 100644 index 57b1f68f62..0000000000 --- a/docs/commands/dfr_get-ordinal.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-ordinal -layout: command -version: 0.59.1 ---- - -Gets ordinal from date - -## Signature - -```> dfr get-ordinal ``` - -## Examples - -Returns ordinal from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-ordinal -``` diff --git a/docs/commands/dfr_get-second.md b/docs/commands/dfr_get-second.md deleted file mode 100644 index 920fe67c69..0000000000 --- a/docs/commands/dfr_get-second.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-second -layout: command -version: 0.59.1 ---- - -Gets second from date - -## Signature - -```> dfr get-second ``` - -## Examples - -Returns second from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-second -``` diff --git a/docs/commands/dfr_get-week.md b/docs/commands/dfr_get-week.md deleted file mode 100644 index 2573ee02a6..0000000000 --- a/docs/commands/dfr_get-week.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-week -layout: command -version: 0.59.1 ---- - -Gets week from date - -## Signature - -```> dfr get-week ``` - -## Examples - -Returns week from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-week -``` diff --git a/docs/commands/dfr_get-weekday.md b/docs/commands/dfr_get-weekday.md deleted file mode 100644 index 6b81642113..0000000000 --- a/docs/commands/dfr_get-weekday.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-weekday -layout: command -version: 0.59.1 ---- - -Gets weekday from date - -## Signature - -```> dfr get-weekday ``` - -## Examples - -Returns weekday from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-weekday -``` diff --git a/docs/commands/dfr_get-year.md b/docs/commands/dfr_get-year.md deleted file mode 100644 index 7441c59da4..0000000000 --- a/docs/commands/dfr_get-year.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr get-year -layout: command -version: 0.59.1 ---- - -Gets year from date - -## Signature - -```> dfr get-year ``` - -## Examples - -Returns year from a date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr get-year -``` diff --git a/docs/commands/dfr_get.md b/docs/commands/dfr_get.md deleted file mode 100644 index 862a7e80e6..0000000000 --- a/docs/commands/dfr_get.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr get -layout: command -version: 0.59.1 ---- - -Creates dataframe with the selected columns - -## Signature - -```> dfr get ...rest``` - -## Parameters - - - `...rest`: column names to sort dataframe - -## Examples - -Creates dataframe with selected columns -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr get a -``` diff --git a/docs/commands/dfr_group-by.md b/docs/commands/dfr_group-by.md deleted file mode 100644 index 9b9643608d..0000000000 --- a/docs/commands/dfr_group-by.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr group-by -layout: command -version: 0.59.1 ---- - -Creates a groupby object that can be used for other aggregations - -## Signature - -```> dfr group-by ...rest``` - -## Parameters - - - `...rest`: groupby columns - -## Examples - -Grouping by column a -```shell -> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a -``` diff --git a/docs/commands/dfr_is-duplicated.md b/docs/commands/dfr_is-duplicated.md deleted file mode 100644 index d81c018cb9..0000000000 --- a/docs/commands/dfr_is-duplicated.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr is-duplicated -layout: command -version: 0.59.1 ---- - -Creates mask indicating duplicated values - -## Signature - -```> dfr is-duplicated ``` - -## Examples - -Create mask indicating duplicated values -```shell -> [5 6 6 6 8 8 8] | dfr to-df | dfr is-duplicated -``` diff --git a/docs/commands/dfr_is-in.md b/docs/commands/dfr_is-in.md deleted file mode 100644 index 67541ec1a7..0000000000 --- a/docs/commands/dfr_is-in.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr is-in -layout: command -version: 0.59.1 ---- - -Checks if elements from a series are contained in right series - -## Signature - -```> dfr is-in (other)``` - -## Parameters - - - `other`: right series - -## Examples - -Checks if elements from a series are contained in right series -```shell -> let other = ([1 3 6] | dfr to-df); - [5 6 6 6 8 8 8] | dfr to-df | dfr is-in $other -``` diff --git a/docs/commands/dfr_is-not-null.md b/docs/commands/dfr_is-not-null.md deleted file mode 100644 index 63fc6a4b89..0000000000 --- a/docs/commands/dfr_is-not-null.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr is-not-null -layout: command -version: 0.59.1 ---- - -Creates mask where value is not null - -## Signature - -```> dfr is-not-null ``` - -## Examples - -Create mask where values are not null -```shell -> let s = ([5 6 0 8] | dfr to-df); - let res = ($s / $s); - $res | dfr is-not-null -``` diff --git a/docs/commands/dfr_is-null.md b/docs/commands/dfr_is-null.md deleted file mode 100644 index fee23caf04..0000000000 --- a/docs/commands/dfr_is-null.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: dfr is-null -layout: command -version: 0.59.1 ---- - -Creates mask where value is null - -## Signature - -```> dfr is-null ``` - -## Examples - -Create mask where values are null -```shell -> let s = ([5 6 0 8] | dfr to-df); - let res = ($s / $s); - $res | dfr is-null -``` diff --git a/docs/commands/dfr_is-unique.md b/docs/commands/dfr_is-unique.md deleted file mode 100644 index 15e522168a..0000000000 --- a/docs/commands/dfr_is-unique.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr is-unique -layout: command -version: 0.59.1 ---- - -Creates mask indicating unique values - -## Signature - -```> dfr is-unique ``` - -## Examples - -Create mask indicating unique values -```shell -> [5 6 6 6 8 8 8] | dfr to-df | dfr is-unique -``` diff --git a/docs/commands/dfr_join.md b/docs/commands/dfr_join.md deleted file mode 100644 index 985af89509..0000000000 --- a/docs/commands/dfr_join.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: dfr join -layout: command -version: 0.59.1 ---- - -Joins a dataframe using columns as reference - -## Signature - -```> dfr join (dataframe) --left --right --type --suffix``` - -## Parameters - - - `dataframe`: right dataframe to join - - `--left {table}`: left column names to perform join - - `--right {table}`: right column names to perform join - - `--type {string}`: type of join. Inner by default - - `--suffix {string}`: suffix for the columns of the right dataframe - -## Examples - -inner join dataframe -```shell -> let right = ([[a b c]; [1 2 5] [3 4 5] [5 6 6]] | dfr to-df); - $right | dfr join $right -l [a b] -r [a b] -``` diff --git a/docs/commands/dfr_last.md b/docs/commands/dfr_last.md deleted file mode 100644 index 9a831e8735..0000000000 --- a/docs/commands/dfr_last.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr last -layout: command -version: 0.59.1 ---- - -Creates new dataframe with tail rows - -## Signature - -```> dfr last (rows)``` - -## Parameters - - - `rows`: Number of rows for tail - -## Examples - -Create new dataframe with last rows -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr last 1 -``` diff --git a/docs/commands/dfr_list.md b/docs/commands/dfr_list.md deleted file mode 100644 index e71f4a90f7..0000000000 --- a/docs/commands/dfr_list.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: dfr list -layout: command -version: 0.59.1 ---- - -Lists stored dataframes - -## Signature - -```> dfr list ``` - -## Examples - -Creates a new dataframe and shows it in the dataframe list -```shell -> let test = ([[a b];[1 2] [3 4]] | dfr to-df); - dfr list -``` diff --git a/docs/commands/dfr_melt.md b/docs/commands/dfr_melt.md deleted file mode 100644 index 01cd5ac601..0000000000 --- a/docs/commands/dfr_melt.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: dfr melt -layout: command -version: 0.59.1 ---- - -Unpivot a DataFrame from wide to long format - -## Signature - -```> dfr melt --columns --values --variable-name --value-name``` - -## Parameters - - - `--columns {table}`: column names for melting - - `--values {table}`: column names used as value columns - - `--variable-name {string}`: optional name for variable column - - `--value-name {string}`: optional name for value column - -## Examples - -melt dataframe -```shell -> [[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | dfr to-df | dfr melt -c [b c] -v [a d] -``` diff --git a/docs/commands/dfr_not.md b/docs/commands/dfr_not.md deleted file mode 100644 index 7acabdffca..0000000000 --- a/docs/commands/dfr_not.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr not -layout: command -version: 0.59.1 ---- - -Inverts boolean mask - -## Signature - -```> dfr not ``` - -## Examples - -Inverts boolean mask -```shell -> [true false true] | dfr to-df | dfr not -``` diff --git a/docs/commands/dfr_open.md b/docs/commands/dfr_open.md deleted file mode 100644 index 5e9c95059c..0000000000 --- a/docs/commands/dfr_open.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: dfr open -layout: command -version: 0.59.1 ---- - -Opens csv, json or parquet file to create dataframe - -## Signature - -```> dfr open (file) --delimiter --no-header --infer-schema --skip-rows --columns``` - -## Parameters - - - `file`: file path to load values from - - `--delimiter {string}`: file delimiter character. CSV file - - `--no-header`: Indicates if file doesn't have header. CSV file - - `--infer-schema {number}`: Number of rows to infer the schema of the file. CSV file - - `--skip-rows {number}`: Number of rows to skip from file. CSV file - - `--columns {list}`: Columns to be selected from csv file. CSV and Parquet file - -## Examples - -Takes a file name and creates a dataframe -```shell -> dfr open test.csv -``` diff --git a/docs/commands/dfr_pivot.md b/docs/commands/dfr_pivot.md deleted file mode 100644 index 14fa858e15..0000000000 --- a/docs/commands/dfr_pivot.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: dfr pivot -layout: command -version: 0.59.1 ---- - -Performs a pivot operation on a groupby object - -## Signature - -```> dfr pivot (pivot_column) (value_column) (operation)``` - -## Parameters - - - `pivot_column`: pivot column to perform pivot - - `value_column`: value column to perform pivot - - `operation`: aggregate operation - -## Examples - -Pivot a dataframe on b and aggregation on col c -```shell -> [[a b c]; [one x 1] [two y 2]] | dfr to-df | dfr group-by a | dfr pivot b c sum -``` diff --git a/docs/commands/dfr_rename-col.md b/docs/commands/dfr_rename-col.md deleted file mode 100644 index 3514840bdb..0000000000 --- a/docs/commands/dfr_rename-col.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr rename-col -layout: command -version: 0.59.1 ---- - -rename a dataframe column - -## Signature - -```> dfr rename-col (from) (to)``` - -## Parameters - - - `from`: column name to be renamed - - `to`: new column name - -## Examples - -Renames a dataframe column -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr rename-col a a_new -``` diff --git a/docs/commands/dfr_rename.md b/docs/commands/dfr_rename.md deleted file mode 100644 index ee78787067..0000000000 --- a/docs/commands/dfr_rename.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr rename -layout: command -version: 0.59.1 ---- - -Renames a series - -## Signature - -```> dfr rename (name)``` - -## Parameters - - - `name`: new series name - -## Examples - -Renames a series -```shell -> [5 6 7 8] | dfr to-df | dfr rename new_name -``` diff --git a/docs/commands/dfr_replace-all.md b/docs/commands/dfr_replace-all.md deleted file mode 100644 index faf9cf30fe..0000000000 --- a/docs/commands/dfr_replace-all.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr replace-all -layout: command -version: 0.59.1 ---- - -Replace all (sub)strings by a regex pattern - -## Signature - -```> dfr replace-all --pattern --replace``` - -## Parameters - - - `--pattern {string}`: Regex pattern to be matched - - `--replace {string}`: replacing string - -## Examples - -Replaces string -```shell -> [abac abac abac] | dfr to-df | dfr replace-all -p a -r A -``` diff --git a/docs/commands/dfr_replace.md b/docs/commands/dfr_replace.md deleted file mode 100644 index f1a256778c..0000000000 --- a/docs/commands/dfr_replace.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr replace -layout: command -version: 0.59.1 ---- - -Replace the leftmost (sub)string by a regex pattern - -## Signature - -```> dfr replace --pattern --replace``` - -## Parameters - - - `--pattern {string}`: Regex pattern to be matched - - `--replace {string}`: replacing string - -## Examples - -Replaces string -```shell -> [abc abc abc] | dfr to-df | dfr replace -p ab -r AB -``` diff --git a/docs/commands/dfr_rolling.md b/docs/commands/dfr_rolling.md deleted file mode 100644 index c35820d813..0000000000 --- a/docs/commands/dfr_rolling.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: dfr rolling -layout: command -version: 0.59.1 ---- - -Rolling calculation for a series - -## Signature - -```> dfr rolling (type) (window)``` - -## Parameters - - - `type`: rolling operation - - `window`: Window size for rolling - -## Examples - -Rolling sum for a series -```shell -> [1 2 3 4 5] | dfr to-df | dfr rolling sum 2 | dfr drop-nulls -``` - -Rolling max for a series -```shell -> [1 2 3 4 5] | dfr to-df | dfr rolling max 2 | dfr drop-nulls -``` diff --git a/docs/commands/dfr_sample.md b/docs/commands/dfr_sample.md deleted file mode 100644 index f4bed3cc76..0000000000 --- a/docs/commands/dfr_sample.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: dfr sample -layout: command -version: 0.59.1 ---- - -Create sample dataframe - -## Signature - -```> dfr sample --n-rows --fraction --replace``` - -## Parameters - - - `--n-rows {int}`: number of rows to be taken from dataframe - - `--fraction {number}`: fraction of dataframe to be taken - - `--replace`: sample with replace - -## Examples - -Sample rows from dataframe -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr sample -n 1 -``` - -Shows sample row using fraction and replace -```shell -> [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr sample -f 0.5 -e -``` diff --git a/docs/commands/dfr_set-with-idx.md b/docs/commands/dfr_set-with-idx.md deleted file mode 100644 index 8fd153a98f..0000000000 --- a/docs/commands/dfr_set-with-idx.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: dfr set-with-idx -layout: command -version: 0.59.1 ---- - -Sets value in the given index - -## Signature - -```> dfr set-with-idx (value) --indices``` - -## Parameters - - - `value`: value to be inserted in series - - `--indices {any}`: list of indices indicating where to set the value - -## Examples - -Set value in selected rows from series -```shell -> let series = ([4 1 5 2 4 3] | dfr to-df); - let indices = ([0 2] | dfr to-df); - $series | dfr set-with-idx 6 -i $indices -``` diff --git a/docs/commands/dfr_set.md b/docs/commands/dfr_set.md deleted file mode 100644 index c90aedc30f..0000000000 --- a/docs/commands/dfr_set.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: dfr set -layout: command -version: 0.59.1 ---- - -Sets value where given mask is true - -## Signature - -```> dfr set (value) --mask``` - -## Parameters - - - `value`: value to be inserted in series - - `--mask {any}`: mask indicating insertions - -## Examples - -Shifts the values by a given period -```shell -> let s = ([1 2 2 3 3] | dfr to-df | dfr shift 2); - let mask = ($s | dfr is-null); - $s | dfr set 0 --mask $mask -``` diff --git a/docs/commands/dfr_shape.md b/docs/commands/dfr_shape.md deleted file mode 100644 index da848fbe5c..0000000000 --- a/docs/commands/dfr_shape.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr shape -layout: command -version: 0.59.1 ---- - -Shows column and row size for a dataframe - -## Signature - -```> dfr shape ``` - -## Examples - -Shows row and column shape -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr shape -``` diff --git a/docs/commands/dfr_shift.md b/docs/commands/dfr_shift.md deleted file mode 100644 index 97436245d4..0000000000 --- a/docs/commands/dfr_shift.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr shift -layout: command -version: 0.59.1 ---- - -Shifts the values by a given period - -## Signature - -```> dfr shift (period)``` - -## Parameters - - - `period`: shift period - -## Examples - -Shifts the values by a given period -```shell -> [1 2 2 3 3] | dfr to-df | dfr shift 2 | dfr drop-nulls -``` diff --git a/docs/commands/dfr_slice.md b/docs/commands/dfr_slice.md deleted file mode 100644 index 043e9ff39e..0000000000 --- a/docs/commands/dfr_slice.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr slice -layout: command -version: 0.59.1 ---- - -Creates new dataframe from a slice of rows - -## Signature - -```> dfr slice (offset) (size)``` - -## Parameters - - - `offset`: start of slice - - `size`: size of slice - -## Examples - -Create new dataframe from a slice of the rows -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr slice 0 1 -``` diff --git a/docs/commands/dfr_sort.md b/docs/commands/dfr_sort.md deleted file mode 100644 index 25d1d09d4e..0000000000 --- a/docs/commands/dfr_sort.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: dfr sort -layout: command -version: 0.59.1 ---- - -Creates new sorted dataframe or series - -## Signature - -```> dfr sort ...rest --reverse``` - -## Parameters - - - `...rest`: column names to sort dataframe - - `--reverse`: invert sort - -## Examples - -Create new sorted dataframe -```shell -> [[a b]; [3 4] [1 2]] | dfr to-df | dfr sort a -``` - -Create new sorted series -```shell -> [3 4 1 2] | dfr to-df | dfr sort -``` diff --git a/docs/commands/dfr_str-lengths.md b/docs/commands/dfr_str-lengths.md deleted file mode 100644 index 10c8549200..0000000000 --- a/docs/commands/dfr_str-lengths.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr str-lengths -layout: command -version: 0.59.1 ---- - -Get lengths of all strings - -## Signature - -```> dfr str-lengths ``` - -## Examples - -Returns string lengths -```shell -> [a ab abc] | dfr to-df | dfr str-lengths -``` diff --git a/docs/commands/dfr_str-slice.md b/docs/commands/dfr_str-slice.md deleted file mode 100644 index 9d6cbff3fb..0000000000 --- a/docs/commands/dfr_str-slice.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr str-slice -layout: command -version: 0.59.1 ---- - -Slices the string from the start position until the selected length - -## Signature - -```> dfr str-slice (start) --length``` - -## Parameters - - - `start`: start of slice - - `--length {int}`: optional length - -## Examples - -Creates slices from the strings -```shell -> [abcded abc321 abc123] | dfr to-df | dfr str-slice 1 -l 2 -``` diff --git a/docs/commands/dfr_strftime.md b/docs/commands/dfr_strftime.md deleted file mode 100644 index c15c17374e..0000000000 --- a/docs/commands/dfr_strftime.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: dfr strftime -layout: command -version: 0.59.1 ---- - -Formats date based on string rule - -## Signature - -```> dfr strftime (fmt)``` - -## Parameters - - - `fmt`: Format rule - -## Examples - -Formats date -```shell -> let dt = ('2020-08-04T16:39:18+00:00' | into datetime -z 'UTC'); - let df = ([$dt $dt] | dfr to-df); - $df | dfr strftime "%Y/%m/%d" -``` diff --git a/docs/commands/dfr_take.md b/docs/commands/dfr_take.md deleted file mode 100644 index 9957aa3f54..0000000000 --- a/docs/commands/dfr_take.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: dfr take -layout: command -version: 0.59.1 ---- - -Creates new dataframe using the given indices - -## Signature - -```> dfr take (indices)``` - -## Parameters - - - `indices`: list of indices used to take data - -## Examples - -Takes selected rows from dataframe -```shell -> let df = ([[a b]; [4 1] [5 2] [4 3]] | dfr to-df); - let indices = ([0 2] | dfr to-df); - $df | dfr take $indices -``` - -Takes selected rows from series -```shell -> let series = ([4 1 5 2 4 3] | dfr to-df); - let indices = ([0 2] | dfr to-df); - $series | dfr take $indices -``` diff --git a/docs/commands/dfr_to-csv.md b/docs/commands/dfr_to-csv.md deleted file mode 100644 index 1c0c4b3ea2..0000000000 --- a/docs/commands/dfr_to-csv.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: dfr to-csv -layout: command -version: 0.59.1 ---- - -Saves dataframe to csv file - -## Signature - -```> dfr to-csv (file) --delimiter --no-header``` - -## Parameters - - - `file`: file path to save dataframe - - `--delimiter {string}`: file delimiter character - - `--no-header`: Indicates if file doesn't have header - -## Examples - -Saves dataframe to csv file -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv -``` - -Saves dataframe to csv file using other delimiter -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv -d '|' -``` diff --git a/docs/commands/dfr_to-df.md b/docs/commands/dfr_to-df.md deleted file mode 100644 index 5e1d8470b5..0000000000 --- a/docs/commands/dfr_to-df.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: dfr to-df -layout: command -version: 0.59.1 ---- - -Converts a List, Table or Dictionary into a dataframe - -## Signature - -```> dfr to-df ``` - -## Examples - -Takes a dictionary and creates a dataframe -```shell -> [[a b];[1 2] [3 4]] | dfr to-df -``` - -Takes a list of tables and creates a dataframe -```shell -> [[1 2 a] [3 4 b] [5 6 c]] | dfr to-df -``` - -Takes a list and creates a dataframe -```shell -> [a b c] | dfr to-df -``` - -Takes a list of booleans and creates a dataframe -```shell -> [true true false] | dfr to-df -``` diff --git a/docs/commands/dfr_to-dummies.md b/docs/commands/dfr_to-dummies.md deleted file mode 100644 index c10d7de317..0000000000 --- a/docs/commands/dfr_to-dummies.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr to-dummies -layout: command -version: 0.59.1 ---- - -Creates a new dataframe with dummy variables - -## Signature - -```> dfr to-dummies ``` - -## Examples - -Create new dataframe with dummy variables from a dataframe -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-dummies -``` - -Create new dataframe with dummy variables from a series -```shell -> [1 2 2 3 3] | dfr to-df | dfr to-dummies -``` diff --git a/docs/commands/dfr_to-lowercase.md b/docs/commands/dfr_to-lowercase.md deleted file mode 100644 index af6ceb91c2..0000000000 --- a/docs/commands/dfr_to-lowercase.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr to-lowercase -layout: command -version: 0.59.1 ---- - -Lowercase the strings in the column - -## Signature - -```> dfr to-lowercase ``` - -## Examples - -Modifies strings to lowercase -```shell -> [Abc aBc abC] | dfr to-df | dfr to-lowercase -``` diff --git a/docs/commands/dfr_to-nu.md b/docs/commands/dfr_to-nu.md deleted file mode 100644 index 3c6231f400..0000000000 --- a/docs/commands/dfr_to-nu.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: dfr to-nu -layout: command -version: 0.59.1 ---- - -Converts a section of the dataframe to Nushell Table - -## Signature - -```> dfr to-nu --n-rows --tail``` - -## Parameters - - - `--n-rows {number}`: number of rows to be shown - - `--tail`: shows tail rows - -## Examples - -Shows head rows from dataframe -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-nu -``` - -Shows tail rows from dataframe -```shell -> [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr to-nu -t -n 1 -``` diff --git a/docs/commands/dfr_to-parquet.md b/docs/commands/dfr_to-parquet.md deleted file mode 100644 index 31ee5580ec..0000000000 --- a/docs/commands/dfr_to-parquet.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: dfr to-parquet -layout: command -version: 0.59.1 ---- - -Saves dataframe to parquet file - -## Signature - -```> dfr to-parquet (file)``` - -## Parameters - - - `file`: file path to save dataframe - -## Examples - -Saves dataframe to csv file -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-parquet test.parquet -``` diff --git a/docs/commands/dfr_to-uppercase.md b/docs/commands/dfr_to-uppercase.md deleted file mode 100644 index b28f9fa4e8..0000000000 --- a/docs/commands/dfr_to-uppercase.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr to-uppercase -layout: command -version: 0.59.1 ---- - -Uppercase the strings in the column - -## Signature - -```> dfr to-uppercase ``` - -## Examples - -Modifies strings to uppercase -```shell -> [Abc aBc abC] | dfr to-df | dfr to-uppercase -``` diff --git a/docs/commands/dfr_unique.md b/docs/commands/dfr_unique.md deleted file mode 100644 index 609ff79126..0000000000 --- a/docs/commands/dfr_unique.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr unique -layout: command -version: 0.59.1 ---- - -Returns unique values from a series - -## Signature - -```> dfr unique ``` - -## Examples - -Returns unique values from a series -```shell -> [2 2 2 2 2] | dfr to-df | dfr unique -``` diff --git a/docs/commands/dfr_value-counts.md b/docs/commands/dfr_value-counts.md deleted file mode 100644 index 8621e71c47..0000000000 --- a/docs/commands/dfr_value-counts.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: dfr value-counts -layout: command -version: 0.59.1 ---- - -Returns a dataframe with the counts for unique values in series - -## Signature - -```> dfr value-counts ``` - -## Examples - -Calculates value counts -```shell -> [5 5 5 5 6 6] | dfr to-df | dfr value-counts -``` diff --git a/docs/commands/dfr_with-column.md b/docs/commands/dfr_with-column.md deleted file mode 100644 index 92e023da66..0000000000 --- a/docs/commands/dfr_with-column.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: dfr with-column -layout: command -version: 0.59.1 ---- - -Adds a series to the dataframe - -## Signature - -```> dfr with-column (series) --name``` - -## Parameters - - - `series`: series to be added - - `--name {string}`: column name - -## Examples - -Adds a series to the dataframe -```shell -> [[a b]; [1 2] [3 4]] | dfr to-df | dfr with-column ([5 6] | dfr to-df) --name c -``` diff --git a/docs/commands/do.md b/docs/commands/do.md deleted file mode 100644 index 973ca400b2..0000000000 --- a/docs/commands/do.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: do -layout: command -version: 0.59.1 ---- - -Run a block - -## Signature - -```> do (block) ...rest --ignore-errors``` - -## Parameters - - - `block`: the block to run - - `...rest`: the parameter(s) for the block - - `--ignore-errors`: ignore errors as the block runs - -## Examples - -Run the block -```shell -> do { echo hello } -``` - -Run the block and ignore errors -```shell -> do -i { thisisnotarealcommand } -``` - -Run the block, with a positional parameter -```shell -> do {|x| 100 + $x } 50 -``` diff --git a/docs/commands/drop.md b/docs/commands/drop.md deleted file mode 100644 index c21d12411b..0000000000 --- a/docs/commands/drop.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: drop -layout: command -version: 0.59.1 ---- - -Remove the last number of rows or columns. - -## Signature - -```> drop (rows)``` - -## Parameters - - - `rows`: starting from the back, the number of rows to remove - -## Examples - -Remove the last item of a list/table -```shell -> [0,1,2,3] | drop -``` - -Remove zero item of a list/table -```shell -> [0,1,2,3] | drop 0 -``` - -Remove the last two items of a list/table -```shell -> [0,1,2,3] | drop 2 -``` diff --git a/docs/commands/drop_column.md b/docs/commands/drop_column.md deleted file mode 100644 index 2d5fa1adfb..0000000000 --- a/docs/commands/drop_column.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: drop column -layout: command -version: 0.59.1 ---- - -Remove the last number of columns. If you want to remove columns by name, try 'reject'. - -## Signature - -```> drop column (columns)``` - -## Parameters - - - `columns`: starting from the end, the number of columns to remove - -## Examples - -Remove the last column of a table -```shell -> echo [[lib, extension]; [nu-lib, rs] [nu-core, rb]] | drop column -``` diff --git a/docs/commands/drop_nth.md b/docs/commands/drop_nth.md deleted file mode 100644 index e051cd8f84..0000000000 --- a/docs/commands/drop_nth.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: drop nth -layout: command -version: 0.59.1 ---- - -Drop the selected rows. - -## Signature - -```> drop nth (row number or row range) ...rest``` - -## Parameters - - - `row number or row range`: the number of the row to drop or a range to drop consecutive rows - - `...rest`: the number of the row to drop - -## Examples - -Drop the first, second, and third row -```shell -> [sam,sarah,2,3,4,5] | drop nth 0 1 2 -``` - -Drop the first, second, and third row -```shell -> [0,1,2,3,4,5] | drop nth 0 1 2 -``` - -Drop rows 0 2 4 -```shell -> [0,1,2,3,4,5] | drop nth 0 2 4 -``` - -Drop rows 2 0 4 -```shell -> [0,1,2,3,4,5] | drop nth 2 0 4 -``` - -Drop range rows from second to fourth -```shell -> echo [first second third fourth fifth] | drop nth (1..3) -``` diff --git a/docs/commands/du.md b/docs/commands/du.md deleted file mode 100644 index fe70791d8b..0000000000 --- a/docs/commands/du.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: du -layout: command -version: 0.59.1 ---- - -Find disk usage sizes of specified items. - -## Signature - -```> du (path) --all --deref --exclude --max-depth --min-size``` - -## Parameters - - - `path`: starting directory - - `--all`: Output file sizes as well as directory sizes - - `--deref`: Dereference symlinks to their targets for size - - `--exclude {glob}`: Exclude these file names - - `--max-depth {int}`: Directory recursion limit - - `--min-size {int}`: Exclude files below this size - -## Examples - -Disk usage of the current directory -```shell -> du -``` diff --git a/docs/commands/each.md b/docs/commands/each.md deleted file mode 100644 index 1e583bc14b..0000000000 --- a/docs/commands/each.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: each -layout: command -version: 0.59.1 ---- - -Run a block on each element of input - -## Signature - -```> each (block) --keep-empty --numbered``` - -## Parameters - - - `block`: the block to run - - `--keep-empty`: keep empty result cells - - `--numbered`: iterate with an index - -## Examples - -Multiplies elements in list -```shell -> [1 2 3] | each { |it| 2 * $it } -``` - -Iterate over each element, keeping only values that succeed -```shell -> [1 2 3] | each { |it| if $it == 2 { echo "found 2!"} } -``` - -Iterate over each element, print the matching value and its index -```shell -> [1 2 3] | each -n { |it| if $it.item == 2 { echo $"found 2 at ($it.index)!"} } -``` - -Iterate over each element, keeping all results -```shell -> [1 2 3] | each --keep-empty { |it| if $it == 2 { echo "found 2!"} } -``` diff --git a/docs/commands/echo.md b/docs/commands/echo.md deleted file mode 100644 index 7f44f7d1ac..0000000000 --- a/docs/commands/echo.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: echo -layout: command -version: 0.59.1 ---- - -Echo the arguments back to the user. - -## Signature - -```> echo ...rest``` - -## Parameters - - - `...rest`: the values to echo - -## Examples - -Put a hello message in the pipeline -```shell -> echo 'hello' -``` - -Print the value of the special '$nu' variable -```shell -> echo $nu -``` diff --git a/docs/commands/empty.md b/docs/commands/empty.md deleted file mode 100644 index ce3a1a8495..0000000000 --- a/docs/commands/empty.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: empty? -layout: command -version: 0.59.1 ---- - -Check for empty values. - -## Signature - -```> empty? ...rest``` - -## Parameters - - - `...rest`: the names of the columns to check emptiness - -## Examples - -Check if a string is empty -```shell -> '' | empty? -``` - -Check if a list is empty -```shell -> [] | empty? -``` - -Check if more than one column are empty -```shell -> [[meal size]; [arepa small] [taco '']] | empty? meal size -``` diff --git a/docs/commands/enter.md b/docs/commands/enter.md deleted file mode 100644 index 8aa598bd82..0000000000 --- a/docs/commands/enter.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: enter -layout: command -version: 0.59.1 ---- - -Enters a new shell at the given path. - -## Signature - -```> enter (path)``` - -## Parameters - - - `path`: the path to enter as a new shell - -## Examples - -Enter a new shell at path '../dir-foo' -```shell -> enter ../dir-foo -``` diff --git a/docs/commands/env.md b/docs/commands/env.md deleted file mode 100644 index 40bc147f44..0000000000 --- a/docs/commands/env.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: env -layout: command -version: 0.59.1 ---- - -Display current environment variables - -## Signature - -```> env ``` - -## Examples - -Display current path environment variable -```shell -> env | where name == PATH -``` - -Check whether the env variable `MY_ENV_ABC` exists -```shell -> env | any? name == MY_ENV_ABC -``` - -Another way to check whether the env variable `PATH` exists -```shell -> 'PATH' in (env).name -``` diff --git a/docs/commands/error_make.md b/docs/commands/error_make.md deleted file mode 100644 index 7c2eddde3d..0000000000 --- a/docs/commands/error_make.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: error make -layout: command -version: 0.59.1 ---- - -Create an error. - -## Signature - -```> error make (error_struct)``` - -## Parameters - - - `error_struct`: the error to create - -## Examples - -Create a custom error for a custom command -```shell -> def foo [x] { - let span = (metadata $x).span; - error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } } - } -``` diff --git a/docs/commands/every.md b/docs/commands/every.md deleted file mode 100644 index 4c42898cfa..0000000000 --- a/docs/commands/every.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: every -layout: command -version: 0.59.1 ---- - -Show (or skip) every n-th row, starting from the first one. - -## Signature - -```> every (stride) --skip``` - -## Parameters - - - `stride`: how many rows to skip between (and including) each row returned - - `--skip`: skip the rows that would be returned, instead of selecting them - -## Examples - -Get every second row -```shell -> [1 2 3 4 5] | every 2 -``` - -Skip every second row -```shell -> [1 2 3 4 5] | every 2 --skip -``` diff --git a/docs/commands/exec.md b/docs/commands/exec.md deleted file mode 100644 index 56e2dacb2d..0000000000 --- a/docs/commands/exec.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: exec -layout: command -version: 0.59.1 ---- - -Execute a command, replacing the current process. - -## Signature - -```> exec (command) ...rest``` - -## Parameters - - - `command`: the command to execute - - `...rest`: any additional arguments for the command - -## Examples - -Execute external 'ps aux' tool -```shell -> exec ps aux -``` - -Execute 'nautilus' -```shell -> exec nautilus -``` diff --git a/docs/commands/exit.md b/docs/commands/exit.md deleted file mode 100644 index 5957124ba7..0000000000 --- a/docs/commands/exit.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: exit -layout: command -version: 0.59.1 ---- - -Runs a script file in the current context. - -## Signature - -```> exit (exit_code) --now``` - -## Parameters - - - `exit_code`: Exit code to return immediately with - - `--now`: Exit out of the shell immediately - -## Examples - -Exit the current shell -```shell -> exit -``` - -Exit all shells (exiting Nu) -```shell -> exit --now -``` diff --git a/docs/commands/export.md b/docs/commands/export.md deleted file mode 100644 index ac6feedd56..0000000000 --- a/docs/commands/export.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: export -layout: command -version: 0.59.1 ---- - -Export custom commands or environment variables from a module. - -## Signature - -```> export ``` - -## Examples - -Export a definition from a module -```shell -> module utils { export def my-command [] { "hello" } }; use utils my-command; my-command -``` diff --git a/docs/commands/export_def-env.md b/docs/commands/export_def-env.md deleted file mode 100644 index fdf8cdebbf..0000000000 --- a/docs/commands/export_def-env.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: export def-env -layout: command -version: 0.59.1 ---- - -Define a custom command that participates in the environment and export it from a module - -## Signature - -```> export def-env (name) (params) (block)``` - -## Parameters - - - `name`: definition name - - `params`: parameters - - `block`: body of the definition - -## Examples - -Define a custom command that participates in the environment in a module and call it -```shell -> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR -``` diff --git a/docs/commands/export_def.md b/docs/commands/export_def.md deleted file mode 100644 index 2d602444b8..0000000000 --- a/docs/commands/export_def.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: export def -layout: command -version: 0.59.1 ---- - -Define a custom command and export it from a module - -## Signature - -```> export def (name) (params) (block)``` - -## Parameters - - - `name`: definition name - - `params`: parameters - - `block`: body of the definition - -## Examples - -Define a custom command in a module and call it -```shell -> module spam { export def foo [] { "foo" } }; use spam foo; foo -``` diff --git a/docs/commands/export_env.md b/docs/commands/export_env.md deleted file mode 100644 index ffc669858c..0000000000 --- a/docs/commands/export_env.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: export env -layout: command -version: 0.59.1 ---- - -Export a block from a module that will be evaluated as an environment variable when imported. - -## Signature - -```> export env (name) (block)``` - -## Parameters - - - `name`: name of the environment variable - - `block`: body of the environment variable definition - -## Examples - -Import and evaluate environment variable from a module -```shell -> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV -``` diff --git a/docs/commands/extern.md b/docs/commands/extern.md deleted file mode 100644 index 1b3bf1b39f..0000000000 --- a/docs/commands/extern.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: extern -layout: command -version: 0.59.1 ---- - -Define a signature for an external command - -## Signature - -```> extern (def_name) (params)``` - -## Parameters - - - `def_name`: definition name - - `params`: parameters - -## Examples - -Write a signature for an external command -```shell -> extern echo [text: string] -``` diff --git a/docs/commands/fetch.md b/docs/commands/fetch.md deleted file mode 100644 index 07b60561a6..0000000000 --- a/docs/commands/fetch.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: fetch -layout: command -version: 0.59.1 ---- - -Fetch the contents from a URL (HTTP GET operation). - -## Signature - -```> fetch (URL) --user --password --timeout --headers --raw``` - -## Parameters - - - `URL`: the URL to fetch the contents from - - `--user {any}`: the username when authenticating - - `--password {any}`: the password when authenticating - - `--timeout {int}`: timeout period in seconds - - `--headers {any}`: custom headers you want to add - - `--raw`: fetch contents as text rather than a table - -## Examples - -Fetch content from url.com -```shell -> fetch url.com -``` - -Fetch content from url.com, with username and password -```shell -> fetch -u myuser -p mypass url.com -``` - -Fetch content from url.com, with custom header -```shell -> fetch -H [my-header-key my-header-value] url.com -``` diff --git a/docs/commands/find.md b/docs/commands/find.md deleted file mode 100644 index fa3167a018..0000000000 --- a/docs/commands/find.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: find -layout: command -version: 0.59.1 ---- - -Searches terms in the input or for elements of the input that satisfies the predicate. - -## Signature - -```> find ...rest --predicate --regex --insensitive --multiline --dotall --invert``` - -## Parameters - - - `...rest`: terms to search - - `--predicate {block}`: the predicate to satisfy - - `--regex {string}`: regex to match with - - `--insensitive`: case-insensitive search for regex (?i) - - `--multiline`: multi-line mode: ^ and $ match begin/end of line for regex (?m) - - `--dotall`: dotall mode: allow a dot . to match newline character \n for regex (?s) - - `--invert`: invert the match - -## Examples - -Search for multiple terms in a command output -```shell -> ls | find toml md sh -``` - -Search for a term in a string -```shell -> echo Cargo.toml | find toml -``` - -Search a number or a file size in a list of numbers -```shell -> [1 5 3kb 4 3Mb] | find 5 3kb -``` - -Search a char in a list of string -```shell -> [moe larry curly] | find l -``` - -Find odd values -```shell -> [2 4 3 6 5 8] | find --predicate { |it| ($it mod 2) == 1 } -``` - -Find if a service is not running -```shell -> [[version patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | find -p { |it| $it.patch } -``` - -Find using regex -```shell -> [abc bde arc abf] | find --regex "ab" -``` - -Find using regex case insensitive -```shell -> [aBc bde Arc abf] | find --regex "ab" -i -``` - -Find value in records -```shell -> [[version name]; [0.1.0 nushell] [0.1.1 fish] [0.2.0 zsh]] | find -r "nu" -``` diff --git a/docs/commands/first.md b/docs/commands/first.md deleted file mode 100644 index fa7067ca1f..0000000000 --- a/docs/commands/first.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: first -layout: command -version: 0.59.1 ---- - -Show only the first number of rows. - -## Signature - -```> first (rows)``` - -## Parameters - - - `rows`: starting from the front, the number of rows to return - -## Examples - -Return the first item of a list/table -```shell -> [1 2 3] | first -``` - -Return the first 2 items of a list/table -```shell -> [1 2 3] | first 2 -``` diff --git a/docs/commands/flatten.md b/docs/commands/flatten.md deleted file mode 100644 index 7701d4ba09..0000000000 --- a/docs/commands/flatten.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: flatten -layout: command -version: 0.59.1 ---- - -Flatten the table. - -## Signature - -```> flatten ...rest``` - -## Parameters - - - `...rest`: optionally flatten data by column - -## Examples - -flatten a table -```shell -> [[N, u, s, h, e, l, l]] | flatten -``` - -flatten a table, get the first item -```shell -> [[N, u, s, h, e, l, l]] | flatten | first -``` - -flatten a column having a nested table -```shell -> [[origin, people]; [Ecuador, ([[name, meal]; ['Andres', 'arepa']])]] | flatten | get meal -``` - -restrict the flattening by passing column names -```shell -> [[origin, crate, versions]; [World, ([[name]; ['nu-cli']]), ['0.21', '0.22']]] | flatten versions | last | get versions -``` - -Flatten inner table -```shell -> { a: b, d: [ 1 2 3 4 ], e: [ 4 3 ] } | flatten -``` diff --git a/docs/commands/fmt.md b/docs/commands/fmt.md deleted file mode 100644 index 530ffe78e6..0000000000 --- a/docs/commands/fmt.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: fmt -layout: command -version: 0.59.1 ---- - -format numbers - -## Signature - -```> fmt ``` - -## Examples - -format numbers -```shell -> 42 | fmt -``` diff --git a/docs/commands/for.md b/docs/commands/for.md deleted file mode 100644 index a918f1d24f..0000000000 --- a/docs/commands/for.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: for -layout: command -version: 0.59.1 ---- - -Loop over a range - -## Signature - -```> for (var_name) (range) (block) --numbered``` - -## Parameters - - - `var_name`: name of the looping variable - - `range`: range of the loop - - `block`: the block to run - - `--numbered`: returned a numbered item ($it.index and $it.item) - -## Examples - -Echo the square of each integer -```shell -> for x in [1 2 3] { $x * $x } -``` - -Work with elements of a range -```shell -> for $x in 1..3 { $x } -``` - -Number each item and echo a message -```shell -> for $it in ['bob' 'fred'] --numbered { $"($it.index) is ($it.item)" } -``` diff --git a/docs/commands/format.md b/docs/commands/format.md deleted file mode 100644 index ac88ed2074..0000000000 --- a/docs/commands/format.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: format -layout: command -version: 0.59.1 ---- - -Format columns into a string using a simple pattern. - -## Signature - -```> format (pattern)``` - -## Parameters - - - `pattern`: the pattern to output. e.g.) "{foo}: {bar}" - -## Examples - -Print filenames with their sizes -```shell -> ls | format '{name}: {size}' -``` - -Print elements from some columns of a table -```shell -> echo [[col1, col2]; [v1, v2] [v3, v4]] | format '{col2}' -``` diff --git a/docs/commands/from.md b/docs/commands/from.md deleted file mode 100644 index e9ee7f20ee..0000000000 --- a/docs/commands/from.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: from -layout: command -version: 0.59.1 ---- - -Parse a string or binary data into structured data - -## Signature - -```> from ``` diff --git a/docs/commands/from_csv.md b/docs/commands/from_csv.md deleted file mode 100644 index 9da998490b..0000000000 --- a/docs/commands/from_csv.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: from csv -layout: command -version: 0.59.1 ---- - -Parse text as .csv and create table. - -## Signature - -```> from csv --separator --noheaders``` - -## Parameters - - - `--separator {string}`: a character to separate columns, defaults to ',' - - `--noheaders`: don't treat the first row as column names - -## Examples - -Convert comma-separated data to a table -```shell -> open data.txt | from csv -``` - -Convert comma-separated data to a table, ignoring headers -```shell -> open data.txt | from csv --noheaders -``` - -Convert comma-separated data to a table, ignoring headers -```shell -> open data.txt | from csv -n -``` - -Convert semicolon-separated data to a table -```shell -> open data.txt | from csv --separator ';' -``` diff --git a/docs/commands/from_eml.md b/docs/commands/from_eml.md deleted file mode 100644 index 19dfc8fc40..0000000000 --- a/docs/commands/from_eml.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: from eml -layout: command -version: 0.59.1 ---- - -Parse text as .eml and create table. - -## Signature - -```> from eml --preview-body``` - -## Parameters - - - `--preview-body {int}`: How many bytes of the body to preview - -## Examples - -Convert eml structured data into table -```shell -> 'From: test@email.com -Subject: Welcome -To: someone@somewhere.com - -Test' | from eml -``` - -Convert eml structured data into table -```shell -> 'From: test@email.com -Subject: Welcome -To: someone@somewhere.com - -Test' | from eml -b 1 -``` diff --git a/docs/commands/from_ics.md b/docs/commands/from_ics.md deleted file mode 100644 index 2272911be1..0000000000 --- a/docs/commands/from_ics.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: from ics -layout: command -version: 0.59.1 ---- - -Parse text as .ics and create table. - -## Signature - -```> from ics ``` - -## Examples - -Converts ics formatted string to table -```shell -> 'BEGIN:VCALENDAR -END:VCALENDAR' | from ics -``` diff --git a/docs/commands/from_ini.md b/docs/commands/from_ini.md deleted file mode 100644 index bbc413742c..0000000000 --- a/docs/commands/from_ini.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: from ini -layout: command -version: 0.59.1 ---- - -Parse text as .ini and create table - -## Signature - -```> from ini ``` - -## Examples - -Converts ini formatted string to table -```shell -> '[foo] -a=1 -b=2' | from ini -``` diff --git a/docs/commands/from_json.md b/docs/commands/from_json.md deleted file mode 100644 index 0d85219174..0000000000 --- a/docs/commands/from_json.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: from json -layout: command -version: 0.59.1 ---- - -Convert from json to structured data - -## Signature - -```> from json --objects``` - -## Parameters - - - `--objects`: treat each line as a separate value - -## Examples - -Converts json formatted string to table -```shell -> '{ "a": 1 }' | from json -``` - -Converts json formatted string to table -```shell -> '{ "a": 1, "b": [1, 2] }' | from json -``` diff --git a/docs/commands/from_nuon.md b/docs/commands/from_nuon.md deleted file mode 100644 index 9be9cbe983..0000000000 --- a/docs/commands/from_nuon.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: from nuon -layout: command -version: 0.59.1 ---- - -Convert from nuon to structured data - -## Signature - -```> from nuon ``` - -## Examples - -Converts nuon formatted string to table -```shell -> '{ a:1 }' | from nuon -``` - -Converts nuon formatted string to table -```shell -> '{ a:1, b: [1, 2] }' | from nuon -``` diff --git a/docs/commands/from_ods.md b/docs/commands/from_ods.md deleted file mode 100644 index cfafe44730..0000000000 --- a/docs/commands/from_ods.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: from ods -layout: command -version: 0.59.1 ---- - -Parse OpenDocument Spreadsheet(.ods) data and create table. - -## Signature - -```> from ods --sheets``` - -## Parameters - - - `--sheets {list}`: Only convert specified sheets - -## Examples - -Convert binary .ods data to a table -```shell -> open test.txt | from ods -``` - -Convert binary .ods data to a table, specifying the tables -```shell -> open test.txt | from ods -s [Spreadsheet1] -``` diff --git a/docs/commands/from_ssv.md b/docs/commands/from_ssv.md deleted file mode 100644 index 9a170d2cd9..0000000000 --- a/docs/commands/from_ssv.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: from ssv -layout: command -version: 0.59.1 ---- - -Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. - -## Signature - -```> from ssv --noheaders --aligned-columns --minimum-spaces``` - -## Parameters - - - `--noheaders`: don't treat the first row as column names - - `--aligned-columns`: assume columns are aligned - - `--minimum-spaces {int}`: the minimum spaces to separate columns - -## Examples - -Converts ssv formatted string to table -```shell -> 'FOO BAR -1 2' | from ssv -``` - -Converts ssv formatted string to table but not treating the first row as column names -```shell -> 'FOO BAR -1 2' | from ssv -n -``` diff --git a/docs/commands/from_toml.md b/docs/commands/from_toml.md deleted file mode 100644 index 98f86576e3..0000000000 --- a/docs/commands/from_toml.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: from toml -layout: command -version: 0.59.1 ---- - -Parse text as .toml and create table. - -## Signature - -```> from toml ``` - -## Examples - -Converts toml formatted string to table -```shell -> 'a = 1' | from toml -``` - -Converts toml formatted string to table -```shell -> 'a = 1 -b = [1, 2]' | from toml -``` diff --git a/docs/commands/from_tsv.md b/docs/commands/from_tsv.md deleted file mode 100644 index e361cb7e83..0000000000 --- a/docs/commands/from_tsv.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: from tsv -layout: command -version: 0.59.1 ---- - -Parse text as .tsv and create table. - -## Signature - -```> from tsv --noheaders``` - -## Parameters - - - `--noheaders`: don't treat the first row as column names - -## Examples - -Create a tsv file with header columns and open it -```shell -> echo $'c1(char tab)c2(char tab)c3(char nl)1(char tab)2(char tab)3' | save tsv-data | open tsv-data | from tsv -``` - -Create a tsv file without header columns and open it -```shell -> echo $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv -n -``` diff --git a/docs/commands/from_url.md b/docs/commands/from_url.md deleted file mode 100644 index 026deab9b2..0000000000 --- a/docs/commands/from_url.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: from url -layout: command -version: 0.59.1 ---- - -Parse url-encoded string as a table. - -## Signature - -```> from url ``` - -## Examples - -Convert url encoded string into a table -```shell -> 'bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter' | from url -``` diff --git a/docs/commands/from_vcf.md b/docs/commands/from_vcf.md deleted file mode 100644 index d7e061214e..0000000000 --- a/docs/commands/from_vcf.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: from vcf -layout: command -version: 0.59.1 ---- - -Parse text as .vcf and create table. - -## Signature - -```> from vcf ``` - -## Examples - -Converts ics formatted string to table -```shell -> 'BEGIN:VCARD -N:Foo -FN:Bar -EMAIL:foo@bar.com -END:VCARD' | from vcf -``` diff --git a/docs/commands/from_xlsx.md b/docs/commands/from_xlsx.md deleted file mode 100644 index e1faf0ef9b..0000000000 --- a/docs/commands/from_xlsx.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: from xlsx -layout: command -version: 0.59.1 ---- - -Parse binary Excel(.xlsx) data and create table. - -## Signature - -```> from xlsx --sheets``` - -## Parameters - - - `--sheets {list}`: Only convert specified sheets - -## Examples - -Convert binary .xlsx data to a table -```shell -> open test.txt | from xlsx -``` - -Convert binary .xlsx data to a table, specifying the tables -```shell -> open test.txt | from xlsx -s [Spreadsheet1] -``` diff --git a/docs/commands/from_xml.md b/docs/commands/from_xml.md deleted file mode 100644 index bc8089fbca..0000000000 --- a/docs/commands/from_xml.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: from xml -layout: command -version: 0.59.1 ---- - -Parse text as .xml and create table. - -## Signature - -```> from xml ``` - -## Examples - -Converts xml formatted string to table -```shell -> ' - - Event -' | from xml -``` diff --git a/docs/commands/from_yaml.md b/docs/commands/from_yaml.md deleted file mode 100644 index 17d3705581..0000000000 --- a/docs/commands/from_yaml.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: from yaml -layout: command -version: 0.59.1 ---- - -Parse text as .yaml/.yml and create table. - -## Signature - -```> from yaml ``` - -## Examples - -Converts yaml formatted string to table -```shell -> 'a: 1' | from yaml -``` - -Converts yaml formatted string to table -```shell -> '[ a: 1, b: [1, 2] ]' | from yaml -``` diff --git a/docs/commands/from_yml.md b/docs/commands/from_yml.md deleted file mode 100644 index 83c1f2fa88..0000000000 --- a/docs/commands/from_yml.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: from yml -layout: command -version: 0.59.1 ---- - -Parse text as .yaml/.yml and create table. - -## Signature - -```> from yml ``` - -## Examples - -Converts yaml formatted string to table -```shell -> 'a: 1' | from yaml -``` - -Converts yaml formatted string to table -```shell -> '[ a: 1, b: [1, 2] ]' | from yaml -``` diff --git a/docs/commands/g.md b/docs/commands/g.md deleted file mode 100644 index 90dc6e16fa..0000000000 --- a/docs/commands/g.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: g -layout: command -version: 0.59.1 ---- - -Switch to a given shell. - -## Signature - -```> g (shell_number)``` - -## Parameters - - - `shell_number`: shell number to change to - -## Examples - -Make two directories and enter new shells for them, use `g` to jump to the specific shell -```shell -> mkdir foo bar; enter foo; enter ../bar; g 1 -``` - -Use `shells` to show all the opened shells and run `g 2` to jump to the third one -```shell -> shells; g 2 -``` diff --git a/docs/commands/get.md b/docs/commands/get.md deleted file mode 100644 index 886589e552..0000000000 --- a/docs/commands/get.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: get -layout: command -version: 0.59.1 ---- - -Extract data using a cell path. - -## Signature - -```> get (cell_path) ...rest --ignore-errors``` - -## Parameters - - - `cell_path`: the cell path to the data - - `...rest`: additional cell paths - - `--ignore-errors`: return nothing if path can't be found - -## Examples - -Extract the name of files as a list -```shell -> ls | get name -``` - -Extract the name of the 3rd entry of a file list -```shell -> ls | get name.2 -``` - -Extract the name of the 3rd entry of a file list (alternative) -```shell -> ls | get 2.name -``` - -Extract the cpu list from the sys information record -```shell -> sys | get cpu -``` diff --git a/docs/commands/grid.md b/docs/commands/grid.md deleted file mode 100644 index 4227455d9d..0000000000 --- a/docs/commands/grid.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: grid -layout: command -version: 0.59.1 ---- - -Renders the output to a textual terminal grid. - -## Signature - -```> grid --width --color --separator``` - -## Parameters - - - `--width {int}`: number of terminal columns wide (not output columns) - - `--color`: draw output with color - - `--separator {string}`: character to separate grid with - -## Examples - -Render a simple list to a grid -```shell -> [1 2 3 a b c] | grid -``` - -The above example is the same as: -```shell -> [1 2 3 a b c] | wrap name | grid -``` - -Render a record to a grid -```shell -> {name: 'foo', b: 1, c: 2} | grid -``` - -Render a list of records to a grid -```shell -> [{name: 'A', v: 1} {name: 'B', v: 2} {name: 'C', v: 3}] | grid -``` - -Render a table with 'name' column in it to a grid -```shell -> [[name patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | grid -``` diff --git a/docs/commands/group-by.md b/docs/commands/group-by.md deleted file mode 100644 index d1eb4d11a8..0000000000 --- a/docs/commands/group-by.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: group-by -layout: command -version: 0.59.1 ---- - -Create a new table grouped. - -## Signature - -```> group-by (grouper)``` - -## Parameters - - - `grouper`: the grouper value to use - -## Examples - -group items by column named "type" -```shell -> ls | group-by type -``` - -you can also group by raw values by leaving out the argument -```shell -> echo ['1' '3' '1' '3' '2' '1' '1'] | group-by -``` diff --git a/docs/commands/group.md b/docs/commands/group.md deleted file mode 100644 index 83fb88f6d8..0000000000 --- a/docs/commands/group.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: group -layout: command -version: 0.59.1 ---- - -Groups input into groups of `group_size`. - -## Signature - -```> group (group_size)``` - -## Parameters - - - `group_size`: the size of each group - -## Examples - -Group the a list by pairs -```shell -> echo [1 2 3 4] | group 2 -``` diff --git a/docs/commands/gstat.md b/docs/commands/gstat.md deleted file mode 100644 index 0fc7353a5a..0000000000 --- a/docs/commands/gstat.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: gstat -layout: command -version: 0.59.1 ---- - -Get the git status of a repo - -## Signature - -```> gstat (path)``` - -## Parameters - - - `path`: path to repo diff --git a/docs/commands/hash.md b/docs/commands/hash.md deleted file mode 100644 index 8d5a1e383b..0000000000 --- a/docs/commands/hash.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: hash -layout: command -version: 0.59.1 ---- - -Apply hash function. - -## Signature - -```> hash ``` diff --git a/docs/commands/hash_base64.md b/docs/commands/hash_base64.md deleted file mode 100644 index 913df51fea..0000000000 --- a/docs/commands/hash_base64.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: hash base64 -layout: command -version: 0.59.1 ---- - -base64 encode or decode a value - -## Signature - -```> hash base64 ...rest --character-set --encode --decode``` - -## Parameters - - - `...rest`: optionally base64 encode / decode data by column paths - - `--character-set {string}`: specify the character rules for encoding the input. - Valid values are 'standard', 'standard-no-padding', 'url-safe', 'url-safe-no-padding','binhex', 'bcrypt', 'crypt' - - `--encode`: encode the input as base64. This is the default behavior if not specified. - - `--decode`: decode the input from base64 - -## Examples - -Base64 encode a string with default settings -```shell -> echo 'username:password' | hash base64 -``` - -Base64 encode a string with the binhex character set -```shell -> echo 'username:password' | hash base64 --character-set binhex --encode -``` - -Base64 decode a value -```shell -> echo 'dXNlcm5hbWU6cGFzc3dvcmQ=' | hash base64 --decode -``` diff --git a/docs/commands/hash_md5.md b/docs/commands/hash_md5.md deleted file mode 100644 index 4ae605729b..0000000000 --- a/docs/commands/hash_md5.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: hash md5 -layout: command -version: 0.59.1 ---- - -hash a value using the md5 hash algorithm - -## Signature - -```> hash md5 ...rest``` - -## Parameters - - - `...rest`: optionally md5 hash data by cell path - -## Examples - -md5 encode a string -```shell -> echo 'abcdefghijklmnopqrstuvwxyz' | hash md5 -``` - -md5 encode a file -```shell -> open ./nu_0_24_1_windows.zip | hash md5 -``` diff --git a/docs/commands/hash_sha256.md b/docs/commands/hash_sha256.md deleted file mode 100644 index 966e772c85..0000000000 --- a/docs/commands/hash_sha256.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: hash sha256 -layout: command -version: 0.59.1 ---- - -hash a value using the sha256 hash algorithm - -## Signature - -```> hash sha256 ...rest``` - -## Parameters - - - `...rest`: optionally sha256 hash data by cell path - -## Examples - -sha256 encode a string -```shell -> echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256 -``` - -sha256 encode a file -```shell -> open ./nu_0_24_1_windows.zip | hash sha256 -``` diff --git a/docs/commands/headers.md b/docs/commands/headers.md deleted file mode 100644 index 5f1a32bdb7..0000000000 --- a/docs/commands/headers.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: headers -layout: command -version: 0.59.1 ---- - -Use the first row of the table as column names. - -## Signature - -```> headers ``` - -## Examples - -Returns headers from table -```shell -> "a b c|1 2 3" | split row "|" | split column " " | headers -``` - -Don't panic on rows with different headers -```shell -> "a b c|1 2 3|1 2 3 4" | split row "|" | split column " " | headers -``` diff --git a/docs/commands/help.md b/docs/commands/help.md deleted file mode 100644 index d6bd9b94f8..0000000000 --- a/docs/commands/help.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: help -layout: command -version: 0.59.1 ---- - -Display help information about commands. - -## Signature - -```> help ...rest --find``` - -## Parameters - - - `...rest`: the name of command to get help on - - `--find {string}`: string to find in command usage - -## Examples - -show all commands and sub-commands -```shell -> help commands -``` - -generate documentation -```shell -> help generate_docs -``` - -show help for single command -```shell -> help match -``` - -show help for single sub-command -```shell -> help str lpad -``` - -search for string in command usage -```shell -> help --find char -``` diff --git a/docs/commands/hide.md b/docs/commands/hide.md deleted file mode 100644 index bc5b0e4db1..0000000000 --- a/docs/commands/hide.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: hide -layout: command -version: 0.59.1 ---- - -Hide symbols in the current scope - -## Signature - -```> hide (pattern)``` - -## Parameters - - - `pattern`: import pattern - -## Examples - -Hide the alias just defined -```shell -> alias lll = ls -l; hide lll -``` - -Hide a custom command -```shell -> def say-hi [] { echo 'Hi!' }; hide say-hi -``` - -Hide an environment variable -```shell -> let-env HZ_ENV_ABC = 1; hide HZ_ENV_ABC; 'HZ_ENV_ABC' in (env).name -``` diff --git a/docs/commands/history.md b/docs/commands/history.md deleted file mode 100644 index 2f371a60a9..0000000000 --- a/docs/commands/history.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: history -layout: command -version: 0.59.1 ---- - -Get the command history - -## Signature - -```> history --clear``` - -## Parameters - - - `--clear`: Clears out the history entries - -## Examples - -Get current history length -```shell -> history | length -``` - -Show last 5 commands you have ran -```shell -> history | last 5 -``` - -Search all the commands from history that contains 'cargo' -```shell -> history | wrap cmd | where cmd =~ cargo -``` diff --git a/docs/commands/if.md b/docs/commands/if.md deleted file mode 100644 index deb6dbaa14..0000000000 --- a/docs/commands/if.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: if -layout: command -version: 0.59.1 ---- - -Conditionally run a block. - -## Signature - -```> if (cond) (then_block) (else_expression)``` - -## Parameters - - - `cond`: condition to check - - `then_block`: block to run if check succeeds - - `else_expression`: expression or block to run if check fails - -## Examples - -Output a value if a condition matches, otherwise return nothing -```shell -> if 2 < 3 { 'yes!' } -``` - -Output a value if a condition matches, else return another value -```shell -> if 5 < 3 { 'yes!' } else { 'no!' } -``` - -Chain multiple if's together -```shell -> if 5 < 3 { 'yes!' } else if 4 < 5 { 'no!' } else { 'okay!' } -``` diff --git a/docs/commands/ignore.md b/docs/commands/ignore.md deleted file mode 100644 index 35c71bf563..0000000000 --- a/docs/commands/ignore.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: ignore -layout: command -version: 0.59.1 ---- - -Ignore the output of the previous command in the pipeline - -## Signature - -```> ignore ``` - -## Examples - -Ignore the output of an echo command -```shell -> echo done | ignore -``` diff --git a/docs/commands/inc.md b/docs/commands/inc.md deleted file mode 100644 index 3fb3e25af0..0000000000 --- a/docs/commands/inc.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: inc -layout: command -version: 0.59.0 ---- - -Increment a value or version. Optionally use the column of a table. - -## Signature - -```> inc --major --minor --patch``` - -## Parameters - - - `--major`: increment the major version (eg 1.2.1 -> 2.0.0) - - `--minor`: increment the minor version (eg 1.2.1 -> 1.3.0) - - `--patch`: increment the patch version (eg 1.2.1 -> 1.2.2) diff --git a/docs/commands/input.md b/docs/commands/input.md deleted file mode 100644 index 1b633fa5a8..0000000000 --- a/docs/commands/input.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: input -layout: command -version: 0.59.1 ---- - -Get input from the user. - -## Signature - -```> input (prompt) --bytes-until``` - -## Parameters - - - `prompt`: prompt to show the user - - `--bytes-until {string}`: read bytes (not text) until a stop byte - -## Examples - -Get input from the user, and assign to a variable -```shell -> let user-input = (input) -``` diff --git a/docs/commands/insert.md b/docs/commands/insert.md deleted file mode 100644 index 99c5bad4b7..0000000000 --- a/docs/commands/insert.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: insert -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> insert ``` diff --git a/docs/commands/into.md b/docs/commands/into.md deleted file mode 100644 index f46fefb56e..0000000000 --- a/docs/commands/into.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: into -layout: command -version: 0.59.1 ---- - -Apply into function. - -## Signature - -```> into ``` diff --git a/docs/commands/into_binary.md b/docs/commands/into_binary.md deleted file mode 100644 index 26dea385a1..0000000000 --- a/docs/commands/into_binary.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: into binary -layout: command -version: 0.59.1 ---- - -Convert value to a binary primitive - -## Signature - -```> into binary ...rest``` - -## Parameters - - - `...rest`: column paths to convert to binary (for table input) - -## Examples - -convert string to a nushell binary primitive -```shell -> 'This is a string that is exactly 52 characters long.' | into binary -``` - -convert a number to a nushell binary primitive -```shell -> 1 | into binary -``` - -convert a boolean to a nushell binary primitive -```shell -> true | into binary -``` - -convert a filesize to a nushell binary primitive -```shell -> ls | where name == LICENSE | get size | into binary -``` - -convert a filepath to a nushell binary primitive -```shell -> ls | where name == LICENSE | get name | path expand | into binary -``` - -convert a decimal to a nushell binary primitive -```shell -> 1.234 | into binary -``` diff --git a/docs/commands/into_bool.md b/docs/commands/into_bool.md deleted file mode 100644 index 0b3423ba80..0000000000 --- a/docs/commands/into_bool.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: into bool -layout: command -version: 0.59.1 ---- - -Convert value to boolean - -## Signature - -```> into bool ...rest``` - -## Parameters - - - `...rest`: column paths to convert to boolean (for table input) - -## Examples - -Convert value to boolean in table -```shell -> echo [[value]; ['false'] ['1'] [0] [1.0] [true]] | into bool value -``` - -Convert bool to boolean -```shell -> true | into bool -``` - -convert integer to boolean -```shell -> 1 | into bool -``` - -convert decimal string to boolean -```shell -> '0.0' | into bool -``` - -convert string to boolean -```shell -> 'true' | into bool -``` diff --git a/docs/commands/into_datetime.md b/docs/commands/into_datetime.md deleted file mode 100644 index 1d02457b48..0000000000 --- a/docs/commands/into_datetime.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: into datetime -layout: command -version: 0.59.1 ---- - -converts text into datetime - -## Signature - -```> into datetime ...rest --list --timezone --offset --format``` - -## Parameters - - - `...rest`: optionally convert text into datetime by column paths - - `--list`: lists strftime cheatsheet - - `--timezone {string}`: Specify timezone if the input is timestamp, like 'UTC/u' or 'LOCAL/l' - - `--offset {int}`: Specify timezone by offset if the input is timestamp, like '+8', '-4', prior than timezone - - `--format {string}`: Specify date and time formatting - -## Examples - -Convert to datetime -```shell -> '16.11.1984 8:00 am +0000' | into datetime -``` - -Convert to datetime -```shell -> '2020-08-04T16:39:18+00:00' | into datetime -``` - -Convert to datetime using a custom format -```shell -> '20200904_163918+0000' | into datetime -f '%Y%m%d_%H%M%S%z' -``` - -Convert timestamp (no larger than 8e+12) to datetime using a specified timezone -```shell -> '1614434140' | into datetime -z 'UTC' -``` - -Convert timestamp (no larger than 8e+12) to datetime using a specified timezone offset (between -12 and 12) -```shell -> '1614434140' | into datetime -o +9 -``` diff --git a/docs/commands/into_decimal.md b/docs/commands/into_decimal.md deleted file mode 100644 index 1d3d7506e2..0000000000 --- a/docs/commands/into_decimal.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: into decimal -layout: command -version: 0.59.1 ---- - -converts text into decimal - -## Signature - -```> into decimal ...rest``` - -## Parameters - - - `...rest`: optionally convert text into decimal by column paths - -## Examples - -Convert string to integer in table -```shell -> [[num]; ['5.01']] | into decimal num -``` - -Convert string to integer -```shell -> '1.345' | into decimal -``` - -Convert decimal to integer -```shell -> '-5.9' | into decimal -``` diff --git a/docs/commands/into_duration.md b/docs/commands/into_duration.md deleted file mode 100644 index 9185422924..0000000000 --- a/docs/commands/into_duration.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: into duration -layout: command -version: 0.59.1 ---- - -Convert value to duration - -## Signature - -```> into duration ...rest``` - -## Parameters - - - `...rest`: column paths to convert to duration (for table input) - -## Examples - -Convert string to duration in table -```shell -> echo [[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value -``` - -Convert string to duration -```shell -> '7min' | into duration -``` diff --git a/docs/commands/into_filesize.md b/docs/commands/into_filesize.md deleted file mode 100644 index ee0b4a2a85..0000000000 --- a/docs/commands/into_filesize.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: into filesize -layout: command -version: 0.59.1 ---- - -Convert value to filesize - -## Signature - -```> into filesize ...rest``` - -## Parameters - - - `...rest`: column paths to convert to filesize (for table input) - -## Examples - -Convert string to filesize in table -```shell -> [[bytes]; ['5'] [3.2] [4] [2kb]] | into filesize bytes -``` - -Convert string to filesize -```shell -> '2' | into filesize -``` - -Convert decimal to filesize -```shell -> 8.3 | into filesize -``` - -Convert int to filesize -```shell -> 5 | into filesize -``` - -Convert file size to filesize -```shell -> 4KB | into filesize -``` diff --git a/docs/commands/into_int.md b/docs/commands/into_int.md deleted file mode 100644 index 643c27a77e..0000000000 --- a/docs/commands/into_int.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: into int -layout: command -version: 0.59.1 ---- - -Convert value to integer - -## Signature - -```> into int ...rest --radix``` - -## Parameters - - - `...rest`: column paths to convert to int (for table input) - - `--radix {number}`: radix of integer - -## Examples - -Convert string to integer in table -```shell -> echo [[num]; ['-5'] [4] [1.5]] | into int num -``` - -Convert string to integer -```shell -> '2' | into int -``` - -Convert decimal to integer -```shell -> 5.9 | into int -``` - -Convert decimal string to integer -```shell -> '5.9' | into int -``` - -Convert file size to integer -```shell -> 4KB | into int -``` - -Convert bool to integer -```shell -> [false, true] | into int -``` - -Convert to integer from binary -```shell -> '1101' | into int -r 2 -``` - -Convert to integer from hex -```shell -> 'FF' | into int -r 16 -``` diff --git a/docs/commands/into_string.md b/docs/commands/into_string.md deleted file mode 100644 index f9a3c36336..0000000000 --- a/docs/commands/into_string.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: into string -layout: command -version: 0.59.1 ---- - -Convert value to string - -## Signature - -```> into string ...rest --decimals``` - -## Parameters - - - `...rest`: column paths to convert to string (for table input) - - `--decimals {int}`: decimal digits to which to round - -## Examples - -convert decimal to string and round to nearest integer -```shell -> 1.7 | into string -d 0 -``` - -convert decimal to string -```shell -> 1.7 | into string -d 1 -``` - -convert decimal to string and limit to 2 decimals -```shell -> 1.734 | into string -d 2 -``` - -try to convert decimal to string and provide negative decimal points -```shell -> 1.734 | into string -d -2 -``` - -convert decimal to string -```shell -> 4.3 | into string -``` - -convert string to string -```shell -> '1234' | into string -``` - -convert boolean to string -```shell -> true | into string -``` - -convert date to string -```shell -> date now | into string -``` - -convert filepath to string -```shell -> ls Cargo.toml | get name | into string -``` - -convert filesize to string -```shell -> ls Cargo.toml | get size | into string -``` diff --git a/docs/commands/keep.md b/docs/commands/keep.md deleted file mode 100644 index febba6c739..0000000000 --- a/docs/commands/keep.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: keep -layout: command -version: 0.59.1 ---- - -Keep the first n elements of the input. - -## Signature - -```> keep (n)``` - -## Parameters - - - `n`: the number of elements to keep - -## Examples - -Keep two elements -```shell -> echo [[editions]; [2015] [2018] [2021]] | keep 2 -``` - -Keep the first value -```shell -> echo [2 4 6 8] | keep -``` diff --git a/docs/commands/keep_until.md b/docs/commands/keep_until.md deleted file mode 100644 index 805954b4d1..0000000000 --- a/docs/commands/keep_until.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: keep until -layout: command -version: 0.59.1 ---- - -Keep elements of the input until a predicate is true. - -## Signature - -```> keep until (predicate)``` - -## Parameters - - - `predicate`: the predicate that kept element must not match - -## Examples - -Keep until the element is positive -```shell -> echo [-1 -2 9 1] | keep until $it > 0 -``` diff --git a/docs/commands/keep_while.md b/docs/commands/keep_while.md deleted file mode 100644 index 08f8e6e8a6..0000000000 --- a/docs/commands/keep_while.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: keep while -layout: command -version: 0.59.1 ---- - -Keep elements of the input while a predicate is true. - -## Signature - -```> keep while (predicate)``` - -## Parameters - - - `predicate`: the predicate that kept element must not match - -## Examples - -Keep while the element is negative -```shell -> echo [-1 -2 9 1] | keep while $it < 0 -``` diff --git a/docs/commands/keybindings.md b/docs/commands/keybindings.md deleted file mode 100644 index d3788f7b5e..0000000000 --- a/docs/commands/keybindings.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: keybindings -layout: command -version: 0.59.1 ---- - -Keybindings related commands - -## Signature - -```> keybindings ``` diff --git a/docs/commands/keybindings_default.md b/docs/commands/keybindings_default.md deleted file mode 100644 index 73c4dd859a..0000000000 --- a/docs/commands/keybindings_default.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: keybindings default -layout: command -version: 0.59.1 ---- - -List default keybindings - -## Signature - -```> keybindings default ``` - -## Examples - -Get list with default keybindings -```shell -> keybindings default -``` diff --git a/docs/commands/keybindings_list.md b/docs/commands/keybindings_list.md deleted file mode 100644 index 42a14a2eb3..0000000000 --- a/docs/commands/keybindings_list.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: keybindings list -layout: command -version: 0.59.1 ---- - -List available options that can be used to create keybindings - -## Signature - -```> keybindings list --modifiers --keycodes --modes --events --edits``` - -## Parameters - - - `--modifiers`: list of modifiers - - `--keycodes`: list of keycodes - - `--modes`: list of edit modes - - `--events`: list of reedline event - - `--edits`: list of edit commands - -## Examples - -Get list of key modifiers -```shell -> keybindings list -m -``` - -Get list of reedline events and edit commands -```shell -> keybindings list -e -d -``` - -Get list with all the available options -```shell -> keybindings list -``` diff --git a/docs/commands/keybindings_listen.md b/docs/commands/keybindings_listen.md deleted file mode 100644 index e3eebb2c9d..0000000000 --- a/docs/commands/keybindings_listen.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: keybindings listen -layout: command -version: 0.59.1 ---- - -Get input from the user. - -## Signature - -```> keybindings listen ``` - -## Examples - -Type and see key event codes -```shell -> keybindings listen -``` diff --git a/docs/commands/kill.md b/docs/commands/kill.md deleted file mode 100644 index f164bdb523..0000000000 --- a/docs/commands/kill.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: kill -layout: command -version: 0.59.1 ---- - -Kill a process using the process id. - -## Signature - -```> kill (pid) ...rest --force --quiet --signal``` - -## Parameters - - - `pid`: process id of process that is to be killed - - `...rest`: rest of processes to kill - - `--force`: forcefully kill the process - - `--quiet`: won't print anything to the console - - `--signal {int}`: signal decimal number to be sent instead of the default 15 (unsupported on Windows) - -## Examples - -Kill the pid using the most memory -```shell -> ps | sort-by mem | last | kill $in.pid -``` - -Force kill a given pid -```shell -> kill --force 12345 -``` - -Send INT signal -```shell -> kill -s 2 12345 -``` diff --git a/docs/commands/last.md b/docs/commands/last.md deleted file mode 100644 index 8f443acba3..0000000000 --- a/docs/commands/last.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: last -layout: command -version: 0.59.1 ---- - -Show only the last number of rows. - -## Signature - -```> last (rows)``` - -## Parameters - - - `rows`: starting from the back, the number of rows to return - -## Examples - -Get the last 2 items -```shell -> [1,2,3] | last 2 -``` diff --git a/docs/commands/length.md b/docs/commands/length.md deleted file mode 100644 index 05501cb616..0000000000 --- a/docs/commands/length.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: length -layout: command -version: 0.59.1 ---- - -Count the number of elements in the input. - -## Signature - -```> length --column``` - -## Parameters - - - `--column`: Show the number of columns in a table - -## Examples - -Count the number of entries in a list -```shell -> echo [1 2 3 4 5] | length -``` - -Count the number of columns in the calendar table -```shell -> cal | length -c -``` diff --git a/docs/commands/let-env.md b/docs/commands/let-env.md deleted file mode 100644 index 178986ade6..0000000000 --- a/docs/commands/let-env.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: let-env -layout: command -version: 0.59.1 ---- - -Create an environment variable and give it a value. - -## Signature - -```> let-env (var_name) (initial_value)``` - -## Parameters - - - `var_name`: variable name - - `initial_value`: equals sign followed by value - -## Examples - -Create an environment variable and display it -```shell -> let-env MY_ENV_VAR = 1; $env.MY_ENV_VAR -``` diff --git a/docs/commands/let.md b/docs/commands/let.md deleted file mode 100644 index a1ad24d775..0000000000 --- a/docs/commands/let.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: let -layout: command -version: 0.59.1 ---- - -Create a variable and give it a value. - -## Signature - -```> let (var_name) (initial_value)``` - -## Parameters - - - `var_name`: variable name - - `initial_value`: equals sign followed by value - -## Examples - -Set a variable to a value -```shell -> let x = 10 -``` - -Set a variable to the result of an expression -```shell -> let x = 10 + 100 -``` - -Set a variable based on the condition -```shell -> let x = if false { -1 } else { 1 } -``` diff --git a/docs/commands/lines.md b/docs/commands/lines.md deleted file mode 100644 index 4ded761cbc..0000000000 --- a/docs/commands/lines.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: lines -layout: command -version: 0.59.1 ---- - -Converts input to lines - -## Signature - -```> lines --skip-empty``` - -## Parameters - - - `--skip-empty`: skip empty lines - -## Examples - -Split multi-line string into lines -```shell -> echo $'two(char nl)lines' | lines -``` diff --git a/docs/commands/load-env.md b/docs/commands/load-env.md deleted file mode 100644 index d4b6985eb0..0000000000 --- a/docs/commands/load-env.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: load-env -layout: command -version: 0.59.1 ---- - -Loads an environment update from a record. - -## Signature - -```> load-env (update)``` - -## Parameters - - - `update`: the record to use for updates - -## Examples - -Load variables from an input stream -```shell -> {NAME: ABE, AGE: UNKNOWN} | load-env; echo $env.NAME -``` - -Load variables from an argument -```shell -> load-env {NAME: ABE, AGE: UNKNOWN}; echo $env.NAME -``` diff --git a/docs/commands/ls.md b/docs/commands/ls.md deleted file mode 100644 index 54e8d7dc42..0000000000 --- a/docs/commands/ls.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: ls -layout: command -version: 0.59.1 ---- - -List the files in a directory. - -## Signature - -```> ls (pattern) --all --long --short-names --full-paths --du``` - -## Parameters - - - `pattern`: the glob pattern to use - - `--all`: Show hidden files - - `--long`: List all available columns for each entry - - `--short-names`: Only print the file names and not the path - - `--full-paths`: display paths as absolute paths - - `--du`: Display the apparent directory size in place of the directory metadata size - -## Examples - -List all files in the current directory -```shell -> ls -``` - -List all files in a subdirectory -```shell -> ls subdir -``` - -List all rust files -```shell -> ls *.rs -``` - -List all files and directories whose name do not contain 'bar' -```shell -> ls -s | where name !~ bar -``` - -List all dirs with full path name in your home directory -```shell -> ls -f ~ | where type == dir -``` - -List all dirs in your home directory which have not been modified in 7 days -```shell -> ls -s ~ | where type == dir && modified < ((date now) - 7day) -``` diff --git a/docs/commands/match.md b/docs/commands/match.md deleted file mode 100644 index 6235261f66..0000000000 --- a/docs/commands/match.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: match -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> match ``` diff --git a/docs/commands/math.md b/docs/commands/math.md deleted file mode 100644 index a9a6a3f1d1..0000000000 --- a/docs/commands/math.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: math -layout: command -version: 0.59.1 ---- - -Use mathematical functions as aggregate functions on a list of numbers or tables. - -## Signature - -```> math ``` diff --git a/docs/commands/math_abs.md b/docs/commands/math_abs.md deleted file mode 100644 index a71d6546fc..0000000000 --- a/docs/commands/math_abs.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math abs -layout: command -version: 0.59.1 ---- - -Returns absolute values of a list of numbers - -## Signature - -```> math abs ``` - -## Examples - -Get absolute of each value in a list of numbers -```shell -> [-50 -100.0 25] | math abs -``` diff --git a/docs/commands/math_avg.md b/docs/commands/math_avg.md deleted file mode 100644 index 0056b19935..0000000000 --- a/docs/commands/math_avg.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math avg -layout: command -version: 0.59.1 ---- - -Finds the average of a list of numbers or tables - -## Signature - -```> math avg ``` - -## Examples - -Get the average of a list of numbers -```shell -> [-50 100.0 25] | math avg -``` diff --git a/docs/commands/math_ceil.md b/docs/commands/math_ceil.md deleted file mode 100644 index 3437973b29..0000000000 --- a/docs/commands/math_ceil.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math ceil -layout: command -version: 0.59.1 ---- - -Applies the ceil function to a list of numbers - -## Signature - -```> math ceil ``` - -## Examples - -Apply the ceil function to a list of numbers -```shell -> [1.5 2.3 -3.1] | math ceil -``` diff --git a/docs/commands/math_eval.md b/docs/commands/math_eval.md deleted file mode 100644 index f4b8ed75fb..0000000000 --- a/docs/commands/math_eval.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: math eval -layout: command -version: 0.59.1 ---- - -Evaluate a math expression into a number - -## Signature - -```> math eval (math expression)``` - -## Parameters - - - `math expression`: the math expression to evaluate - -## Examples - -Evaluate math in the pipeline -```shell -> '10 / 4' | math eval -``` diff --git a/docs/commands/math_floor.md b/docs/commands/math_floor.md deleted file mode 100644 index 71d5f13671..0000000000 --- a/docs/commands/math_floor.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math floor -layout: command -version: 0.59.1 ---- - -Applies the floor function to a list of numbers - -## Signature - -```> math floor ``` - -## Examples - -Apply the floor function to a list of numbers -```shell -> [1.5 2.3 -3.1] | math floor -``` diff --git a/docs/commands/math_max.md b/docs/commands/math_max.md deleted file mode 100644 index 5b33b4c736..0000000000 --- a/docs/commands/math_max.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math max -layout: command -version: 0.59.1 ---- - -Finds the maximum within a list of numbers or tables - -## Signature - -```> math max ``` - -## Examples - -Find the maximum of list of numbers -```shell -> [-50 100 25] | math max -``` diff --git a/docs/commands/math_median.md b/docs/commands/math_median.md deleted file mode 100644 index c8b281b305..0000000000 --- a/docs/commands/math_median.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math median -layout: command -version: 0.59.1 ---- - -Gets the median of a list of numbers - -## Signature - -```> math median ``` - -## Examples - -Get the median of a list of numbers -```shell -> [3 8 9 12 12 15] | math median -``` diff --git a/docs/commands/math_min.md b/docs/commands/math_min.md deleted file mode 100644 index 18aa0eb553..0000000000 --- a/docs/commands/math_min.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math min -layout: command -version: 0.59.1 ---- - -Finds the minimum within a list of numbers or tables - -## Signature - -```> math min ``` - -## Examples - -Get the minimum of a list of numbers -```shell -> [-50 100 25] | math min -``` diff --git a/docs/commands/math_mode.md b/docs/commands/math_mode.md deleted file mode 100644 index eab319640d..0000000000 --- a/docs/commands/math_mode.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math mode -layout: command -version: 0.59.1 ---- - -Gets the most frequent element(s) from a list of numbers or tables - -## Signature - -```> math mode ``` - -## Examples - -Get the mode(s) of a list of numbers -```shell -> [3 3 9 12 12 15] | math mode -``` diff --git a/docs/commands/math_product.md b/docs/commands/math_product.md deleted file mode 100644 index cbf171ce19..0000000000 --- a/docs/commands/math_product.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math product -layout: command -version: 0.59.1 ---- - -Finds the product of a list of numbers or tables - -## Signature - -```> math product ``` - -## Examples - -Get the product of a list of numbers -```shell -> [2 3 3 4] | math product -``` diff --git a/docs/commands/math_round.md b/docs/commands/math_round.md deleted file mode 100644 index 54957d6d8c..0000000000 --- a/docs/commands/math_round.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: math round -layout: command -version: 0.59.1 ---- - -Applies the round function to a list of numbers - -## Signature - -```> math round --precision``` - -## Parameters - - - `--precision {number}`: digits of precision - -## Examples - -Apply the round function to a list of numbers -```shell -> [1.5 2.3 -3.1] | math round -``` - -Apply the round function with precision specified -```shell -> [1.555 2.333 -3.111] | math round -p 2 -``` diff --git a/docs/commands/math_sqrt.md b/docs/commands/math_sqrt.md deleted file mode 100644 index 5f95046f1d..0000000000 --- a/docs/commands/math_sqrt.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: math sqrt -layout: command -version: 0.59.1 ---- - -Applies the square root function to a list of numbers - -## Signature - -```> math sqrt ``` - -## Examples - -Apply the square root function to a list of numbers -```shell -> [9 16] | math sqrt -``` diff --git a/docs/commands/math_stddev.md b/docs/commands/math_stddev.md deleted file mode 100644 index 258fd8c1ef..0000000000 --- a/docs/commands/math_stddev.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: math stddev -layout: command -version: 0.59.1 ---- - -Finds the stddev of a list of numbers or tables - -## Signature - -```> math stddev --sample``` - -## Parameters - - - `--sample`: calculate sample standard deviation - -## Examples - -Get the stddev of a list of numbers -```shell -> [1 2 3 4 5] | math stddev -``` - -Get the sample stddev of a list of numbers -```shell -> [1 2 3 4 5] | math stddev -s -``` diff --git a/docs/commands/math_sum.md b/docs/commands/math_sum.md deleted file mode 100644 index 5f3f9af0bf..0000000000 --- a/docs/commands/math_sum.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: math sum -layout: command -version: 0.59.1 ---- - -Finds the sum of a list of numbers or tables - -## Signature - -```> math sum ``` - -## Examples - -Sum a list of numbers -```shell -> [1 2 3] | math sum -``` - -Get the disk usage for the current directory -```shell -> ls | get size | math sum -``` diff --git a/docs/commands/math_variance.md b/docs/commands/math_variance.md deleted file mode 100644 index 00563ad392..0000000000 --- a/docs/commands/math_variance.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: math variance -layout: command -version: 0.59.1 ---- - -Finds the variance of a list of numbers or tables - -## Signature - -```> math variance --sample``` - -## Parameters - - - `--sample`: calculate sample variance - -## Examples - -Get the variance of a list of numbers -```shell -> echo [1 2 3 4 5] | math variance -``` - -Get the sample variance of a list of numbers -```shell -> [1 2 3 4 5] | math variance -s -``` diff --git a/docs/commands/merge.md b/docs/commands/merge.md deleted file mode 100644 index b452f8109e..0000000000 --- a/docs/commands/merge.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: merge -layout: command -version: 0.59.1 ---- - -Merge a table into an input table - -## Signature - -```> merge (block)``` - -## Parameters - - - `block`: the block to run and merge into the table - -## Examples - -Merge an index column into the input table -```shell -> [a b c] | wrap name | merge { [1 2 3] | wrap index } -``` - -Merge two records -```shell -> {a: 1, b: 2} | merge { {c: 3} } -``` diff --git a/docs/commands/metadata.md b/docs/commands/metadata.md deleted file mode 100644 index 89e71f3400..0000000000 --- a/docs/commands/metadata.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: metadata -layout: command -version: 0.59.1 ---- - -Get the metadata for items in the stream - -## Signature - -```> metadata (expression)``` - -## Parameters - - - `expression`: the expression you want metadata for - -## Examples - -Get the metadata of a variable -```shell -> metadata $a -``` - -Get the metadata of the input -```shell -> ls | metadata -``` diff --git a/docs/commands/mkdir.md b/docs/commands/mkdir.md deleted file mode 100644 index 0477a6bd3f..0000000000 --- a/docs/commands/mkdir.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: mkdir -layout: command -version: 0.59.1 ---- - -Make directories, creates intermediary directories as required. - -## Signature - -```> mkdir ...rest --show-created-paths``` - -## Parameters - - - `...rest`: the name(s) of the path(s) to create - - `--show-created-paths`: show the path(s) created. - -## Examples - -Make a directory named foo -```shell -> mkdir foo -``` - -Make multiple directories and show the paths created -```shell -> mkdir -s foo/bar foo2 -``` diff --git a/docs/commands/module.md b/docs/commands/module.md deleted file mode 100644 index b0d1fbe9bd..0000000000 --- a/docs/commands/module.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: module -layout: command -version: 0.59.1 ---- - -Define a custom module - -## Signature - -```> module (module_name) (block)``` - -## Parameters - - - `module_name`: module name - - `block`: body of the module - -## Examples - -Define a custom command in a module and call it -```shell -> module spam { export def foo [] { "foo" } }; use spam foo; foo -``` - -Define an environment variable in a module and evaluate it -```shell -> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV -``` - -Define a custom command that participates in the environment in a module and call it -```shell -> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR -``` diff --git a/docs/commands/move.md b/docs/commands/move.md deleted file mode 100644 index 330446642c..0000000000 --- a/docs/commands/move.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: move -layout: command -version: 0.59.1 ---- - -Move columns before or after other columns - -## Signature - -```> move ...columns --after --before``` - -## Parameters - - - `...columns`: the columns to move - - `--after {string}`: the column that will precede the columns moved - - `--before {string}`: the column that will be the next after the columns moved - -## Examples - -Move a column before the first column -```shell -> [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move index --before name -``` - -Move multiple columns after the last column and reorder them -```shell -> [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move value name --after index -``` - -Move columns of a record -```shell -> { name: foo, value: a, index: 1 } | move name --before index -``` diff --git a/docs/commands/mv.md b/docs/commands/mv.md deleted file mode 100644 index 44bb5b55bf..0000000000 --- a/docs/commands/mv.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: mv -layout: command -version: 0.59.1 ---- - -Move files or directories. - -## Signature - -```> mv (source) (destination)``` - -## Parameters - - - `source`: the location to move files/directories from - - `destination`: the location to move files/directories to - -## Examples - -Rename a file -```shell -> mv before.txt after.txt -``` - -Move a file into a directory -```shell -> mv test.txt my/subdirectory -``` - -Move many files into a directory -```shell -> mv *.txt my/subdirectory -``` diff --git a/docs/commands/n.md b/docs/commands/n.md deleted file mode 100644 index 6dcad273c9..0000000000 --- a/docs/commands/n.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: n -layout: command -version: 0.59.1 ---- - -Switch to the next shell. - -## Signature - -```> n ``` - -## Examples - -Make two directories and enter new shells for them, use `n` to jump to the next shell -```shell -> mkdir foo bar; enter foo; enter ../bar; n -``` - -Run `n` several times and note the changes of current directory -```shell -> n -``` diff --git a/docs/commands/nth.md b/docs/commands/nth.md deleted file mode 100644 index a6fc1427f0..0000000000 --- a/docs/commands/nth.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: nth -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> nth ``` diff --git a/docs/commands/nu-highlight.md b/docs/commands/nu-highlight.md deleted file mode 100644 index 4354b7ecd0..0000000000 --- a/docs/commands/nu-highlight.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: nu-highlight -layout: command -version: 0.59.1 ---- - -Syntax highlight the input string. - -## Signature - -```> nu-highlight ``` - -## Examples - -Describe the type of a string -```shell -> 'let x = 3' | nu-highlight -``` diff --git a/docs/commands/open.md b/docs/commands/open.md deleted file mode 100644 index bbbd143e35..0000000000 --- a/docs/commands/open.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: open -layout: command -version: 0.59.1 ---- - -Load a file into a cell, converting to table if possible (avoid by appending '--raw'). - -## Signature - -```> open (filename) --raw``` - -## Parameters - - - `filename`: the filename to use - - `--raw`: open file as raw binary - -## Examples - -Open a file, with structure (based on file extension) -```shell -> open myfile.json -``` - -Open a file, as raw bytes -```shell -> open myfile.json --raw -``` - -Open a file, using the input to get filename -```shell -> echo 'myfile.txt' | open -``` - -Open a file, and decode it by the specified encoding -```shell -> open myfile.txt --raw | decode utf-8 -``` diff --git a/docs/commands/p.md b/docs/commands/p.md deleted file mode 100644 index 2c31ada9a4..0000000000 --- a/docs/commands/p.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: p -layout: command -version: 0.59.1 ---- - -Switch to the previous shell. - -## Signature - -```> p ``` - -## Examples - -Make two directories and enter new shells for them, use `p` to jump to the previous shell -```shell -> mkdir foo bar; enter foo; enter ../bar; p -``` - -Run `p` several times and note the changes of current directory -```shell -> p -``` diff --git a/docs/commands/par-each.md b/docs/commands/par-each.md deleted file mode 100644 index ee92a8899f..0000000000 --- a/docs/commands/par-each.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: par-each -layout: command -version: 0.59.1 ---- - -Run a block on each element of input in parallel - -## Signature - -```> par-each (block) --numbered``` - -## Parameters - - - `block`: the block to run - - `--numbered`: iterate with an index - -## Examples - -Multiplies elements in list -```shell -> [1 2 3] | par-each { |it| 2 * $it } -``` - -Iterate over each element, print the matching value and its index -```shell -> [1 2 3] | par-each -n { |it| if $it.item == 2 { echo $"found 2 at ($it.index)!"} } -``` diff --git a/docs/commands/parse.md b/docs/commands/parse.md deleted file mode 100644 index 76a6a3d60b..0000000000 --- a/docs/commands/parse.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: parse -layout: command -version: 0.59.1 ---- - -Parse columns from string data using a simple pattern. - -## Signature - -```> parse (pattern) --regex``` - -## Parameters - - - `pattern`: the pattern to match. Eg) "{foo}: {bar}" - - `--regex`: use full regex syntax for patterns - -## Examples - -Parse a string into two named columns -```shell -> echo "hi there" | parse "{foo} {bar}" -``` - -Parse a string using regex pattern -```shell -> echo "hi there" | parse -r '(?P\w+) (?P\w+)' -``` diff --git a/docs/commands/path.md b/docs/commands/path.md deleted file mode 100644 index 3aba20b253..0000000000 --- a/docs/commands/path.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: path -layout: command -version: 0.59.1 ---- - -Explore and manipulate paths. - -## Signature - -```> path ``` diff --git a/docs/commands/path_basename.md b/docs/commands/path_basename.md deleted file mode 100644 index b96e2d6f9b..0000000000 --- a/docs/commands/path_basename.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: path basename -layout: command -version: 0.59.1 ---- - -Get the final component of a path - -## Signature - -```> path basename --columns --replace``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - - `--replace {string}`: Return original path with basename replaced by this string - -## Examples - -Get basename of a path -```shell -> '/home/joe/test.txt' | path basename -``` - -Get basename of a path by column -```shell -> [[name];[/home/joe]] | path basename -c [ name ] -``` - -Replace basename of a path -```shell -> '/home/joe/test.txt' | path basename -r 'spam.png' -``` diff --git a/docs/commands/path_dirname.md b/docs/commands/path_dirname.md deleted file mode 100644 index ccb333a488..0000000000 --- a/docs/commands/path_dirname.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: path dirname -layout: command -version: 0.59.1 ---- - -Get the parent directory of a path - -## Signature - -```> path dirname --columns --replace --num-levels``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - - `--replace {string}`: Return original path with dirname replaced by this string - - `--num-levels {int}`: Number of directories to walk up - -## Examples - -Get dirname of a path -```shell -> '/home/joe/code/test.txt' | path dirname -``` - -Get dirname of a path in a column -```shell -> ls ('.' | path expand) | path dirname -c [ name ] -``` - -Walk up two levels -```shell -> '/home/joe/code/test.txt' | path dirname -n 2 -``` - -Replace the part that would be returned with a custom path -```shell -> '/home/joe/code/test.txt' | path dirname -n 2 -r /home/viking -``` diff --git a/docs/commands/path_exists.md b/docs/commands/path_exists.md deleted file mode 100644 index 3aef6a9efa..0000000000 --- a/docs/commands/path_exists.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: path exists -layout: command -version: 0.59.1 ---- - -Check whether a path exists - -## Signature - -```> path exists --columns``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - -## Examples - -Check if a file exists -```shell -> '/home/joe/todo.txt' | path exists -``` - -Check if a file exists in a column -```shell -> ls | path exists -c [ name ] -``` diff --git a/docs/commands/path_expand.md b/docs/commands/path_expand.md deleted file mode 100644 index 0db3beddca..0000000000 --- a/docs/commands/path_expand.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: path expand -layout: command -version: 0.59.1 ---- - -Try to expand a path to its absolute form - -## Signature - -```> path expand --strict --columns``` - -## Parameters - - - `--strict`: Throw an error if the path could not be expanded - - `--columns {table}`: Optionally operate by column path - -## Examples - -Expand an absolute path -```shell -> '/home/joe/foo/../bar' | path expand -``` - -Expand a path in a column -```shell -> ls | path expand -c [ name ] -``` - -Expand a relative path -```shell -> 'foo/../bar' | path expand -``` diff --git a/docs/commands/path_join.md b/docs/commands/path_join.md deleted file mode 100644 index 2e361fd868..0000000000 --- a/docs/commands/path_join.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: path join -layout: command -version: 0.59.1 ---- - -Join a structured path or a list of path parts. - -## Signature - -```> path join (append) --columns``` - -## Parameters - - - `append`: Path to append to the input - - `--columns {table}`: Optionally operate by column path - -## Examples - -Append a filename to a path -```shell -> '/home/viking' | path join spam.txt -``` - -Append a filename to a path inside a column -```shell -> ls | path join spam.txt -c [ name ] -``` - -Join a list of parts into a path -```shell -> [ '/' 'home' 'viking' 'spam.txt' ] | path join -``` - -Join a structured path into a path -```shell -> [[ parent stem extension ]; [ '/home/viking' 'spam' 'txt' ]] | path join -``` diff --git a/docs/commands/path_parse.md b/docs/commands/path_parse.md deleted file mode 100644 index a010b5e00f..0000000000 --- a/docs/commands/path_parse.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: path parse -layout: command -version: 0.59.1 ---- - -Convert a path into structured data. - -## Signature - -```> path parse --columns --extension``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - - `--extension {string}`: Manually supply the extension (without the dot) - -## Examples - -Parse a path -```shell -> '/home/viking/spam.txt' | path parse -``` - -Replace a complex extension -```shell -> '/home/viking/spam.tar.gz' | path parse -e tar.gz | update extension { 'txt' } -``` - -Ignore the extension -```shell -> '/etc/conf.d' | path parse -e '' -``` - -Parse all paths under the 'name' column -```shell -> ls | path parse -c [ name ] -``` diff --git a/docs/commands/path_relative-to.md b/docs/commands/path_relative-to.md deleted file mode 100644 index 50cc0ce357..0000000000 --- a/docs/commands/path_relative-to.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: path relative-to -layout: command -version: 0.59.1 ---- - -Get a path as relative to another path. - -## Signature - -```> path relative-to (path) --columns``` - -## Parameters - - - `path`: Parent shared with the input path - - `--columns {table}`: Optionally operate by column path - -## Examples - -Find a relative path from two absolute paths -```shell -> '/home/viking' | path relative-to '/home' -``` - -Find a relative path from two absolute paths in a column -```shell -> ls ~ | path relative-to ~ -c [ name ] -``` - -Find a relative path from two relative paths -```shell -> 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage' -``` diff --git a/docs/commands/path_split.md b/docs/commands/path_split.md deleted file mode 100644 index ff63e300c6..0000000000 --- a/docs/commands/path_split.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: path split -layout: command -version: 0.59.1 ---- - -Split a path into parts by a separator. - -## Signature - -```> path split --columns``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - -## Examples - -Split a path into parts -```shell -> '/home/viking/spam.txt' | path split -``` - -Split all paths under the 'name' column -```shell -> ls ('.' | path expand) | path split -c [ name ] -``` diff --git a/docs/commands/path_type.md b/docs/commands/path_type.md deleted file mode 100644 index 96dd0534c8..0000000000 --- a/docs/commands/path_type.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: path type -layout: command -version: 0.59.1 ---- - -Get the type of the object a path refers to (e.g., file, dir, symlink) - -## Signature - -```> path type --columns``` - -## Parameters - - - `--columns {table}`: Optionally operate by column path - -## Examples - -Show type of a filepath -```shell -> '.' | path type -``` - -Show type of a filepath in a column -```shell -> ls | path type -c [ name ] -``` diff --git a/docs/commands/pivot.md b/docs/commands/pivot.md deleted file mode 100644 index 2746f8bf10..0000000000 --- a/docs/commands/pivot.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: pivot -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> pivot ``` diff --git a/docs/commands/post.md b/docs/commands/post.md deleted file mode 100644 index e5a781fb0b..0000000000 --- a/docs/commands/post.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: post -layout: command -version: 0.59.1 ---- - -Post a body to a URL (HTTP POST operation). - -## Signature - -```> post (path) (body) --user --password --content-type --content-length --headers --raw --insecure``` - -## Parameters - - - `path`: the URL to post to - - `body`: the contents of the post body - - `--user {any}`: the username when authenticating - - `--password {any}`: the password when authenticating - - `--content-type {any}`: the MIME type of content to post - - `--content-length {any}`: the length of the content being posted - - `--headers {any}`: custom headers you want to add - - `--raw`: return values as a string instead of a table - - `--insecure`: allow insecure server connections when using SSL - -## Examples - -Post content to url.com -```shell -> post url.com 'body' -``` - -Post content to url.com, with username and password -```shell -> post -u myuser -p mypass url.com 'body' -``` - -Post content to url.com, with custom header -```shell -> post -H [my-header-key my-header-value] url.com -``` - -Post content to url.com with a json body -```shell -> post -t application/json url.com { field: value } -``` diff --git a/docs/commands/prepend.md b/docs/commands/prepend.md deleted file mode 100644 index 07bba36a74..0000000000 --- a/docs/commands/prepend.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: prepend -layout: command -version: 0.59.1 ---- - -Prepend a row to the table. - -## Signature - -```> prepend (row)``` - -## Parameters - - - `row`: the row to prepend - -## Examples - -Prepend one Int item -```shell -> [1,2,3,4] | prepend 0 -``` - -Prepend two Int items -```shell -> [2,3,4] | prepend [0,1] -``` - -Prepend Ints and Strings -```shell -> [2,nu,4,shell] | prepend [0,1,rocks] -``` diff --git a/docs/commands/print.md b/docs/commands/print.md deleted file mode 100644 index 2648f06259..0000000000 --- a/docs/commands/print.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: print -layout: command -version: 0.59.1 ---- - -Prints the values given - -## Signature - -```> print ...rest``` - -## Parameters - - - `...rest`: the values to print - -## Examples - -Print 'hello world' -```shell -> print "hello world" -``` - -Print the sum of 2 and 3 -```shell -> print (2 + 3) -``` diff --git a/docs/commands/ps.md b/docs/commands/ps.md deleted file mode 100644 index 4b8f1132b6..0000000000 --- a/docs/commands/ps.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: ps -layout: command -version: 0.59.1 ---- - -View information about system processes. - -## Signature - -```> ps --long``` - -## Parameters - - - `--long`: list all available columns for each entry - -## Examples - -List the system processes -```shell -> ps -``` - -List the top 5 system processes with the highest memory usage -```shell -> ps | sort-by mem | last 5 -``` - -List the top 3 system processes with the highest CPU usage -```shell -> ps | sort-by cpu | last 3 -``` - -List the system processes with 'nu' in their names -```shell -> ps | where name =~ 'nu' -``` diff --git a/docs/commands/query.md b/docs/commands/query.md deleted file mode 100644 index 9f6bf2a640..0000000000 --- a/docs/commands/query.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: query -layout: command -version: 0.59.1 ---- - -Show all the query commands - -## Signature - -```> query ``` diff --git a/docs/commands/query_json.md b/docs/commands/query_json.md deleted file mode 100644 index bf31644c9f..0000000000 --- a/docs/commands/query_json.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: query json -layout: command -version: 0.59.1 ---- - -execute json query on json file (open --raw | query json 'query string') - -## Signature - -```> query json (query)``` - -## Parameters - - - `query`: json query diff --git a/docs/commands/query_web.md b/docs/commands/query_web.md deleted file mode 100644 index b8a549e104..0000000000 --- a/docs/commands/query_web.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: query web -layout: command -version: 0.59.1 ---- - -execute selector query on html/web - -## Signature - -```> query web --query --as-html --attribute --as-table --inspect``` - -## Parameters - - - `--query {string}`: selector query - - `--as-html`: return the query output as html - - `--attribute {string}`: downselect based on the given attribute - - `--as-table {any}`: find table based on column header list - - `--inspect`: run in inspect mode to provide more information for determining column headers diff --git a/docs/commands/query_xml.md b/docs/commands/query_xml.md deleted file mode 100644 index 2d1a8dd070..0000000000 --- a/docs/commands/query_xml.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: query xml -layout: command -version: 0.59.1 ---- - -execute xpath query on xml - -## Signature - -```> query xml (query)``` - -## Parameters - - - `query`: xpath query diff --git a/docs/commands/random.md b/docs/commands/random.md deleted file mode 100644 index 7b0fb2ec0d..0000000000 --- a/docs/commands/random.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: random -layout: command -version: 0.59.1 ---- - -Generate a random values. - -## Signature - -```> random ``` diff --git a/docs/commands/random_bool.md b/docs/commands/random_bool.md deleted file mode 100644 index 8663c4b9fb..0000000000 --- a/docs/commands/random_bool.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: random bool -layout: command -version: 0.59.1 ---- - -Generate a random boolean value - -## Signature - -```> random bool --bias``` - -## Parameters - - - `--bias {number}`: Adjusts the probability of a "true" outcome - -## Examples - -Generate a random boolean value -```shell -> random bool -``` - -Generate a random boolean value with a 75% chance of "true" -```shell -> random bool --bias 0.75 -``` diff --git a/docs/commands/random_chars.md b/docs/commands/random_chars.md deleted file mode 100644 index ee338a56ef..0000000000 --- a/docs/commands/random_chars.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: random chars -layout: command -version: 0.59.1 ---- - -Generate random chars - -## Signature - -```> random chars --length``` - -## Parameters - - - `--length {int}`: Number of chars - -## Examples - -Generate random chars -```shell -> random chars -``` - -Generate random chars with specified length -```shell -> random chars -l 20 -``` diff --git a/docs/commands/random_decimal.md b/docs/commands/random_decimal.md deleted file mode 100644 index 51ebe0ee49..0000000000 --- a/docs/commands/random_decimal.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: random decimal -layout: command -version: 0.59.1 ---- - -Generate a random decimal within a range [min..max] - -## Signature - -```> random decimal (range)``` - -## Parameters - - - `range`: Range of values - -## Examples - -Generate a default decimal value between 0 and 1 -```shell -> random decimal -``` - -Generate a random decimal less than or equal to 500 -```shell -> random decimal ..500 -``` - -Generate a random decimal greater than or equal to 100000 -```shell -> random decimal 100000.. -``` - -Generate a random decimal between 1.0 and 1.1 -```shell -> random decimal 1.0..1.1 -``` diff --git a/docs/commands/random_dice.md b/docs/commands/random_dice.md deleted file mode 100644 index 9b444407eb..0000000000 --- a/docs/commands/random_dice.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: random dice -layout: command -version: 0.59.1 ---- - -Generate a random dice roll - -## Signature - -```> random dice --dice --sides``` - -## Parameters - - - `--dice {int}`: The amount of dice being rolled - - `--sides {int}`: The amount of sides a die has - -## Examples - -Roll 1 dice with 6 sides each -```shell -> random dice -``` - -Roll 10 dice with 12 sides each -```shell -> random dice -d 10 -s 12 -``` diff --git a/docs/commands/random_integer.md b/docs/commands/random_integer.md deleted file mode 100644 index 3771e1512a..0000000000 --- a/docs/commands/random_integer.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: random integer -layout: command -version: 0.59.1 ---- - -Generate a random integer [min..max] - -## Signature - -```> random integer (range)``` - -## Parameters - - - `range`: Range of values - -## Examples - -Generate an unconstrained random integer -```shell -> random integer -``` - -Generate a random integer less than or equal to 500 -```shell -> random integer ..500 -``` - -Generate a random integer greater than or equal to 100000 -```shell -> random integer 100000.. -``` - -Generate a random integer between 1 and 10 -```shell -> random integer 1..10 -``` diff --git a/docs/commands/random_uuid.md b/docs/commands/random_uuid.md deleted file mode 100644 index ceb2a20374..0000000000 --- a/docs/commands/random_uuid.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: random uuid -layout: command -version: 0.59.1 ---- - -Generate a random uuid4 string - -## Signature - -```> random uuid ``` - -## Examples - -Generate a random uuid4 string -```shell -> random uuid -``` diff --git a/docs/commands/range.md b/docs/commands/range.md deleted file mode 100644 index 69fd48f7a8..0000000000 --- a/docs/commands/range.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: range -layout: command -version: 0.59.1 ---- - -Return only the selected rows. - -## Signature - -```> range (rows)``` - -## Parameters - - - `rows`: range of rows to return: Eg) 4..7 (=> from 4 to 7) - -## Examples - -Get the last 2 items -```shell -> [0,1,2,3,4,5] | range 4..5 -``` - -Get the last 2 items -```shell -> [0,1,2,3,4,5] | range (-2).. -``` - -Get the next to last 2 items -```shell -> [0,1,2,3,4,5] | range (-3)..-2 -``` diff --git a/docs/commands/reduce.md b/docs/commands/reduce.md deleted file mode 100644 index 7fefd2af03..0000000000 --- a/docs/commands/reduce.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: reduce -layout: command -version: 0.59.1 ---- - -Aggregate a list table to a single value using an accumulator block. - -## Signature - -```> reduce (block) --fold --numbered``` - -## Parameters - - - `block`: reducing function - - `--fold {any}`: reduce with initial value - - `--numbered`: iterate with an index - -## Examples - -Sum values of a list (same as 'math sum') -```shell -> [ 1 2 3 4 ] | reduce {|it, acc| $it + $acc } -``` - -Sum values of a list (same as 'math sum') -```shell -> [ 1 2 3 ] | reduce -n {|it, acc| $acc + $it.item } -``` - -Sum values with a starting value (fold) -```shell -> [ 1 2 3 4 ] | reduce -f 10 {|it, acc| $acc + $it } -``` - -Replace selected characters in a string with 'X' -```shell -> [ i o t ] | reduce -f "Arthur, King of the Britons" {|it, acc| $acc | str find-replace -a $it "X" } -``` - -Find the longest string and its index -```shell -> [ one longest three bar ] | reduce -n { |it, acc| - if ($it.item | str length) > ($acc | str length) { - $it.item - } else { - $acc - } - } -``` diff --git a/docs/commands/register.md b/docs/commands/register.md deleted file mode 100644 index d40aa5baef..0000000000 --- a/docs/commands/register.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: register -layout: command -version: 0.59.1 ---- - -Register a plugin - -## Signature - -```> register (plugin) (signature) --encoding --shell``` - -## Parameters - - - `plugin`: path of executable for plugin - - `signature`: Block with signature description as json object - - `--encoding {string}`: Encoding used to communicate with plugin. Options: [capnp, json] - - `--shell {path}`: path of shell used to run plugin (cmd, sh, python, etc) - -## Examples - -Register `nu_plugin_query` plugin from ~/.cargo/bin/ dir -```shell -> register -e capnp ~/.cargo/bin/nu_plugin_query -``` - -Register `nu_plugin_query` plugin from `nu -c`(plugin will be available in that nu session only) -```shell -> let plugin = ((which nu).path.0 | path dirname | path join 'nu_plugin_query'); nu -c $'register -e capnp ($plugin); version' -``` diff --git a/docs/commands/reject.md b/docs/commands/reject.md deleted file mode 100644 index 4c050c7ad2..0000000000 --- a/docs/commands/reject.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: reject -layout: command -version: 0.59.1 ---- - -Remove the given columns from the table. If you want to remove rows, try 'drop'. - -## Signature - -```> reject ...rest``` - -## Parameters - - - `...rest`: the names of columns to remove from the table - -## Examples - -Lists the files in a directory without showing the modified column -```shell -> ls | reject modified -``` - -Reject the specified field in a record -```shell -> echo {a: 1, b: 2} | reject a -``` diff --git a/docs/commands/rename.md b/docs/commands/rename.md deleted file mode 100644 index 3487a8c6a5..0000000000 --- a/docs/commands/rename.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: rename -layout: command -version: 0.59.1 ---- - -Creates a new table with columns renamed. - -## Signature - -```> rename ...rest --column``` - -## Parameters - - - `...rest`: the new names for the columns - - `--column {list}`: column name to be changed - -## Examples - -Rename a column -```shell -> [[a, b]; [1, 2]] | rename my_column -``` - -Rename many columns -```shell -> [[a, b, c]; [1, 2, 3]] | rename eggs ham bacon -``` - -Rename a specific column -```shell -> [[a, b, c]; [1, 2, 3]] | rename -c [a ham] -``` diff --git a/docs/commands/reverse.md b/docs/commands/reverse.md deleted file mode 100644 index 0f52f23bf9..0000000000 --- a/docs/commands/reverse.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: reverse -layout: command -version: 0.59.1 ---- - -Reverses the table. - -## Signature - -```> reverse ``` - -## Examples - -Reverse the items -```shell -> [0,1,2,3] | reverse -``` diff --git a/docs/commands/rm.md b/docs/commands/rm.md deleted file mode 100644 index 901be2f56b..0000000000 --- a/docs/commands/rm.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: rm -layout: command -version: 0.59.1 ---- - -Remove file(s). - -## Signature - -```> rm ...rest --trash --permanent --recursive --force --quiet``` - -## Parameters - - - `...rest`: the file path(s) to remove - - `--trash`: use the platform's recycle bin instead of permanently deleting - - `--permanent`: don't use recycle bin, delete permanently - - `--recursive`: delete subdirectories recursively - - `--force`: suppress error when no file - - `--quiet`: suppress output showing files deleted - -## Examples - -Delete or move a file to the system trash (depending on 'rm_always_trash' config option) -```shell -> rm file.txt -``` - -Move a file to the system trash -```shell -> rm --trash file.txt -``` - -Delete a file permanently -```shell -> rm --permanent file.txt -``` - -Delete a file, and suppress errors if no file is found -```shell -> rm --force file.txt -``` diff --git a/docs/commands/roll.md b/docs/commands/roll.md deleted file mode 100644 index 7bf2e01613..0000000000 --- a/docs/commands/roll.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: roll -layout: command -version: 0.59.1 ---- - -Rolling commands for tables - -## Signature - -```> roll ``` diff --git a/docs/commands/roll_down.md b/docs/commands/roll_down.md deleted file mode 100644 index a66957a067..0000000000 --- a/docs/commands/roll_down.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: roll down -layout: command -version: 0.59.1 ---- - -Roll table rows down - -## Signature - -```> roll down --by``` - -## Parameters - - - `--by {int}`: Number of rows to roll - -## Examples - -Rolls rows down -```shell -> [[a b]; [1 2] [3 4] [5 6]] | roll down -``` diff --git a/docs/commands/roll_left.md b/docs/commands/roll_left.md deleted file mode 100644 index 576aaa2c34..0000000000 --- a/docs/commands/roll_left.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: roll left -layout: command -version: 0.59.1 ---- - -Roll table columns left - -## Signature - -```> roll left --by --cells-only``` - -## Parameters - - - `--by {int}`: Number of columns to roll - - `--cells-only`: rotates columns leaving headers fixed - -## Examples - -Rolls columns to the left -```shell -> [[a b c]; [1 2 3] [4 5 6]] | roll left -``` - -Rolls columns to the left with fixed headers -```shell -> [[a b c]; [1 2 3] [4 5 6]] | roll left --cells-only -``` diff --git a/docs/commands/roll_right.md b/docs/commands/roll_right.md deleted file mode 100644 index 8958777e15..0000000000 --- a/docs/commands/roll_right.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: roll right -layout: command -version: 0.59.1 ---- - -Roll table columns right - -## Signature - -```> roll right --by --cells-only``` - -## Parameters - - - `--by {int}`: Number of columns to roll - - `--cells-only`: rotates columns leaving headers fixed - -## Examples - -Rolls columns to the right -```shell -> [[a b c]; [1 2 3] [4 5 6]] | roll right -``` - -Rolls columns to the right with fixed headers -```shell -> [[a b c]; [1 2 3] [4 5 6]] | roll right --cells-only -``` diff --git a/docs/commands/roll_up.md b/docs/commands/roll_up.md deleted file mode 100644 index a5043edf9d..0000000000 --- a/docs/commands/roll_up.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: roll up -layout: command -version: 0.59.1 ---- - -Roll table rows up - -## Signature - -```> roll up --by``` - -## Parameters - - - `--by {int}`: Number of rows to roll - -## Examples - -Rolls rows up -```shell -> [[a b]; [1 2] [3 4] [5 6]] | roll up -``` diff --git a/docs/commands/rotate.md b/docs/commands/rotate.md deleted file mode 100644 index 45c947c581..0000000000 --- a/docs/commands/rotate.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: rotate -layout: command -version: 0.59.1 ---- - -Rotates a table clockwise (default) or counter-clockwise (use --ccw flag). - -## Signature - -```> rotate ...rest --ccw``` - -## Parameters - - - `...rest`: the names to give columns once rotated - - `--ccw`: rotate counter clockwise - -## Examples - -Rotate 2x2 table clockwise -```shell -> [[a b]; [1 2]] | rotate -``` - -Rotate 2x3 table clockwise -```shell -> [[a b]; [1 2] [3 4] [5 6]] | rotate -``` - -Rotate table clockwise and change columns names -```shell -> [[a b]; [1 2]] | rotate col_a col_b -``` - -Rotate table counter clockwise -```shell -> [[a b]; [1 2]] | rotate --ccw -``` - -Rotate table counter-clockwise -```shell -> [[a b]; [1 2] [3 4] [5 6]] | rotate --ccw -``` - -Rotate table counter-clockwise and change columns names -```shell -> [[a b]; [1 2]] | rotate --ccw col_a col_b -``` diff --git a/docs/commands/run-external.md b/docs/commands/run-external.md deleted file mode 100644 index ddf8758d31..0000000000 --- a/docs/commands/run-external.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: run-external -layout: command -version: 0.59.1 ---- - -Runs external command - -## Signature - -```> run-external ...rest --redirect-stdout --redirect-stderr``` - -## Parameters - - - `...rest`: external command to run - - `--redirect-stdout`: redirect-stdout - - `--redirect-stderr`: redirect-stderr - -## Examples - -Run an external command -```shell -> run-external "echo" "-n" "hello" -``` diff --git a/docs/commands/save.md b/docs/commands/save.md deleted file mode 100644 index 5f379572df..0000000000 --- a/docs/commands/save.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: save -layout: command -version: 0.59.1 ---- - -Save a file. - -## Signature - -```> save (filename) --raw --append``` - -## Parameters - - - `filename`: the filename to use - - `--raw`: save file as raw binary - - `--append`: append input to the end of the file - -## Examples - -Save a string to foo.txt in current directory -```shell -> echo 'save me' | save foo.txt -``` - -Save a record to foo.json in current directory -```shell -> echo { a: 1, b: 2 } | save foo.json -``` diff --git a/docs/commands/select.md b/docs/commands/select.md deleted file mode 100644 index 02772f52a5..0000000000 --- a/docs/commands/select.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: select -layout: command -version: 0.59.1 ---- - -Down-select table to only these columns. - -## Signature - -```> select ...rest``` - -## Parameters - - - `...rest`: the columns to select from the table - -## Examples - -Select just the name column -```shell -> ls | select name -``` - -Select the name and size columns -```shell -> ls | select name size -``` diff --git a/docs/commands/seq.md b/docs/commands/seq.md deleted file mode 100644 index 7202f2f332..0000000000 --- a/docs/commands/seq.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: seq -layout: command -version: 0.59.1 ---- - -Print sequences of numbers. - -## Signature - -```> seq ...rest --separator --terminator --widths``` - -## Parameters - - - `...rest`: sequence values - - `--separator {string}`: separator character (defaults to \n) - - `--terminator {string}`: terminator character (defaults to \n) - - `--widths`: equalize widths of all numbers by padding with zeros - -## Examples - -sequence 1 to 10 with newline separator -```shell -> seq 1 10 -``` - -sequence 1.0 to 2.0 by 0.1s with newline separator -```shell -> seq 1.0 0.1 2.0 -``` - -sequence 1 to 10 with pipe separator -```shell -> seq -s '|' 1 10 -``` - -sequence 1 to 10 with pipe separator padded with 0 -```shell -> seq -s '|' -w 1 10 -``` - -sequence 1 to 10 with pipe separator padded by 2s -```shell -> seq -s ' | ' -w 1 2 10 -``` diff --git a/docs/commands/seq_date.md b/docs/commands/seq_date.md deleted file mode 100644 index 9888b52695..0000000000 --- a/docs/commands/seq_date.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: seq date -layout: command -version: 0.59.1 ---- - -print sequences of dates - -## Signature - -```> seq date --separator --output-format --input-format --begin-date --end-date --increment --days --reverse``` - -## Parameters - - - `--separator {string}`: separator character (defaults to \n) - - `--output-format {string}`: prints dates in this format (defaults to %Y-%m-%d) - - `--input-format {string}`: give argument dates in this format (defaults to %Y-%m-%d) - - `--begin-date {string}`: beginning date range - - `--end-date {string}`: ending date - - `--increment {int}`: increment dates by this number - - `--days {int}`: number of days to print - - `--reverse`: print dates in reverse - -## Examples - -print the next 10 days in YYYY-MM-DD format with newline separator -```shell -> seq date --days 10 -``` - -print the previous 10 days in YYYY-MM-DD format with newline separator -```shell -> seq date --days 10 -r -``` - -print the previous 10 days starting today in MM/DD/YYYY format with newline separator -```shell -> seq date --days 10 -o '%m/%d/%Y' -r -``` - -print the first 10 days in January, 2020 -```shell -> seq date -b '2020-01-01' -e '2020-01-10' -``` - -print every fifth day between January 1st 2020 and January 31st 2020 -```shell -> seq date -b '2020-01-01' -e '2020-01-31' -n 5 -``` - -starting on May 5th, 2020, print the next 10 days in your locale's date format, colon separated -```shell -> seq date -o %x -s ':' -d 10 -b '2020-05-01' -``` diff --git a/docs/commands/shells.md b/docs/commands/shells.md deleted file mode 100644 index 7fadaf7849..0000000000 --- a/docs/commands/shells.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: shells -layout: command -version: 0.59.1 ---- - -Lists all open shells. - -## Signature - -```> shells ``` - -## Examples - -Enter a new shell at parent path '..' and show all opened shells -```shell -> enter ..; shells -``` - -Show currently active shell -```shell -> shells | where active == true -``` diff --git a/docs/commands/shuffle.md b/docs/commands/shuffle.md deleted file mode 100644 index 73dd946dfd..0000000000 --- a/docs/commands/shuffle.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: shuffle -layout: command -version: 0.59.1 ---- - -Shuffle rows randomly. - -## Signature - -```> shuffle ``` - -## Examples - -Shuffle rows randomly (execute it several times and see the difference) -```shell -> echo [[version patch]; [1.0.0 false] [3.0.1 true] [2.0.0 false]] | shuffle -``` diff --git a/docs/commands/size.md b/docs/commands/size.md deleted file mode 100644 index ad22424e21..0000000000 --- a/docs/commands/size.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: size -layout: command -version: 0.59.1 ---- - -Gather word count statistics on the text. - -## Signature - -```> size ``` - -## Examples - -Count the number of words in a string -```shell -> "There are seven words in this sentence" | size -``` - -Counts Unicode characters correctly in a string -```shell -> "Amélie Amelie" | size -``` diff --git a/docs/commands/skip.md b/docs/commands/skip.md deleted file mode 100644 index 67771b4f3a..0000000000 --- a/docs/commands/skip.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: skip -layout: command -version: 0.59.1 ---- - -Skip the first n elements of the input. - -## Signature - -```> skip (n)``` - -## Parameters - - - `n`: the number of elements to skip - -## Examples - -Skip two elements -```shell -> echo [[editions]; [2015] [2018] [2021]] | skip 2 -``` - -Skip the first value -```shell -> echo [2 4 6 8] | skip -``` diff --git a/docs/commands/skip_until.md b/docs/commands/skip_until.md deleted file mode 100644 index d19d618990..0000000000 --- a/docs/commands/skip_until.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: skip until -layout: command -version: 0.59.1 ---- - -Skip elements of the input until a predicate is true. - -## Signature - -```> skip until (predicate)``` - -## Parameters - - - `predicate`: the predicate that skipped element must not match - -## Examples - -Skip until the element is positive -```shell -> echo [-2 0 2 -1] | skip until $it > 0 -``` diff --git a/docs/commands/skip_while.md b/docs/commands/skip_while.md deleted file mode 100644 index e2618f2a3f..0000000000 --- a/docs/commands/skip_while.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: skip while -layout: command -version: 0.59.1 ---- - -Skip elements of the input while a predicate is true. - -## Signature - -```> skip while (predicate)``` - -## Parameters - - - `predicate`: the predicate that skipped element must match - -## Examples - -Skip while the element is negative -```shell -> echo [-2 0 2 -1] | skip while $it < 0 -``` diff --git a/docs/commands/sleep.md b/docs/commands/sleep.md deleted file mode 100644 index fce5bd5b00..0000000000 --- a/docs/commands/sleep.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: sleep -layout: command -version: 0.59.1 ---- - -Delay for a specified amount of time. - -## Signature - -```> sleep (duration) ...rest``` - -## Parameters - - - `duration`: time to sleep - - `...rest`: additional time - -## Examples - -Sleep for 1sec -```shell -> sleep 1sec -``` - -Sleep for 3sec -```shell -> sleep 1sec 1sec 1sec -``` - -Send output after 1sec -```shell -> sleep 1sec; echo done -``` diff --git a/docs/commands/sort-by.md b/docs/commands/sort-by.md deleted file mode 100644 index ab6d74c781..0000000000 --- a/docs/commands/sort-by.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: sort-by -layout: command -version: 0.59.1 ---- - -Sort by the given columns, in increasing order. - -## Signature - -```> sort-by ...columns --reverse --insensitive``` - -## Parameters - - - `...columns`: the column(s) to sort by - - `--reverse`: Sort in reverse order - - `--insensitive`: Sort string-based columns case-insensitively - -## Examples - -sort the list by increasing value -```shell -> [2 0 1] | sort-by -``` - -sort the list by decreasing value -```shell -> [2 0 1] | sort-by -r -``` - -sort a list of strings -```shell -> [betty amy sarah] | sort-by -``` - -sort a list of strings in reverse -```shell -> [betty amy sarah] | sort-by -r -``` - -Sort strings (case-insensitive) -```shell -> echo [airplane Truck Car] | sort-by -i -``` - -Sort strings (reversed case-insensitive) -```shell -> echo [airplane Truck Car] | sort-by -i -r -``` diff --git a/docs/commands/source.md b/docs/commands/source.md deleted file mode 100644 index 58617df625..0000000000 --- a/docs/commands/source.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: source -layout: command -version: 0.59.1 ---- - -Runs a script file in the current context. - -## Signature - -```> source (filename)``` - -## Parameters - - - `filename`: the filepath to the script file to source - -## Examples - -Runs foo.nu in the current context -```shell -> source foo.nu -``` - -Runs foo.nu in current context and call the command defined, suppose foo.nu has content: `def say-hi [] { echo 'Hi!' }` -```shell -> source ./foo.nu; say-hi -``` - -Runs foo.nu in current context and call the `main` command automatically, suppose foo.nu has content: `def main [] { echo 'Hi!' }` -```shell -> source ./foo.nu -``` diff --git a/docs/commands/split-by.md b/docs/commands/split-by.md deleted file mode 100644 index 5b4e5eb138..0000000000 --- a/docs/commands/split-by.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: split-by -layout: command -version: 0.59.1 ---- - -Create a new table splitted. - -## Signature - -```> split-by (splitter)``` - -## Parameters - - - `splitter`: the splitter value to use - -## Examples - -split items by column named "lang" -```shell -> - { - '2019': [ - { name: 'andres', lang: 'rb', year: '2019' }, - { name: 'jt', lang: 'rs', year: '2019' } - ], - '2021': [ - { name: 'storm', lang: 'rs', 'year': '2021' } - ] - } | split-by lang - -``` diff --git a/docs/commands/split.md b/docs/commands/split.md deleted file mode 100644 index a15caf1017..0000000000 --- a/docs/commands/split.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: split -layout: command -version: 0.59.1 ---- - -Split contents across desired subcommand (like row, column) via the separator. - -## Signature - -```> split ``` diff --git a/docs/commands/split_chars.md b/docs/commands/split_chars.md deleted file mode 100644 index 4209baa8b3..0000000000 --- a/docs/commands/split_chars.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: split chars -layout: command -version: 0.59.1 ---- - -splits a string's characters into separate rows - -## Signature - -```> split chars ``` - -## Examples - -Split the string's characters into separate rows -```shell -> 'hello' | split chars -``` diff --git a/docs/commands/split_column.md b/docs/commands/split_column.md deleted file mode 100644 index af92694f2c..0000000000 --- a/docs/commands/split_column.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: split column -layout: command -version: 0.59.1 ---- - -splits contents across multiple columns via the separator. - -## Signature - -```> split column (separator) ...rest --collapse-empty``` - -## Parameters - - - `separator`: the character that denotes what separates columns - - `...rest`: column names to give the new columns - - `--collapse-empty`: remove empty columns - -## Examples - -Split a string into columns by the specified separator -```shell -> echo 'a--b--c' | split column '--' -``` - -Split a string into columns of char and remove the empty columns -```shell -> echo 'abc' | split column -c '' -``` diff --git a/docs/commands/split_row.md b/docs/commands/split_row.md deleted file mode 100644 index 0cdd632b66..0000000000 --- a/docs/commands/split_row.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: split row -layout: command -version: 0.59.1 ---- - -splits contents over multiple rows via the separator. - -## Signature - -```> split row (separator)``` - -## Parameters - - - `separator`: the character that denotes what separates rows - -## Examples - -Split a string into rows of char -```shell -> echo 'abc' | split row '' -``` - -Split a string into rows by the specified separator -```shell -> echo 'a--b--c' | split row '--' -``` diff --git a/docs/commands/str.md b/docs/commands/str.md deleted file mode 100644 index 38f73b655c..0000000000 --- a/docs/commands/str.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: str -layout: command -version: 0.59.1 ---- - -Various commands for working with string data. - -## Signature - -```> str ``` diff --git a/docs/commands/str_camel-case.md b/docs/commands/str_camel-case.md deleted file mode 100644 index a727109f5d..0000000000 --- a/docs/commands/str_camel-case.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str camel-case -layout: command -version: 0.59.1 ---- - -converts a string to camelCase - -## Signature - -```> str camel-case ...rest``` - -## Parameters - - - `...rest`: optionally convert text to camelCase by column paths - -## Examples - -convert a string to camelCase -```shell -> 'NuShell' | str camel-case -``` - -convert a string to camelCase -```shell -> 'this-is-the-first-case' | str camel-case -``` - -convert a string to camelCase -```shell -> 'this_is_the_second_case' | str camel-case -``` - -convert a column from a table to camelCase -```shell -> [[lang, gems]; [nu_test, 100]] | str camel-case lang -``` diff --git a/docs/commands/str_capitalize.md b/docs/commands/str_capitalize.md deleted file mode 100644 index fb3d530018..0000000000 --- a/docs/commands/str_capitalize.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: str capitalize -layout: command -version: 0.59.1 ---- - -capitalizes text - -## Signature - -```> str capitalize ...rest``` - -## Parameters - - - `...rest`: optionally capitalize text by column paths - -## Examples - -Capitalize contents -```shell -> 'good day' | str capitalize -``` - -Capitalize contents -```shell -> 'anton' | str capitalize -``` - -Capitalize a column in a table -```shell -> [[lang, gems]; [nu_test, 100]] | str capitalize lang -``` diff --git a/docs/commands/str_collect.md b/docs/commands/str_collect.md deleted file mode 100644 index 2b9a616038..0000000000 --- a/docs/commands/str_collect.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: str collect -layout: command -version: 0.59.1 ---- - -creates a string from the input, optionally using a separator - -## Signature - -```> str collect (separator)``` - -## Parameters - - - `separator`: optional separator to use when creating string - -## Examples - -Create a string from input -```shell -> ['nu', 'shell'] | str collect -``` - -Create a string from input with a separator -```shell -> ['nu', 'shell'] | str collect '-' -``` diff --git a/docs/commands/str_contains.md b/docs/commands/str_contains.md deleted file mode 100644 index 929353c34d..0000000000 --- a/docs/commands/str_contains.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: str contains -layout: command -version: 0.59.1 ---- - -Checks if string contains pattern - -## Signature - -```> str contains (pattern) ...rest --insensitive --not``` - -## Parameters - - - `pattern`: the pattern to find - - `...rest`: optionally check if string contains pattern by column paths - - `--insensitive`: search is case insensitive - - `--not`: does not contain - -## Examples - -Check if string contains pattern -```shell -> 'my_library.rb' | str contains '.rb' -``` - -Check if string contains pattern case insensitive -```shell -> 'my_library.rb' | str contains -i '.RB' -``` - -Check if string contains pattern in a table -```shell -> [[ColA ColB]; [test 100]] | str contains 'e' ColA -``` - -Check if string contains pattern in a table -```shell -> [[ColA ColB]; [test 100]] | str contains -i 'E' ColA -``` - -Check if string contains pattern in a table -```shell -> [[ColA ColB]; [test hello]] | str contains 'e' ColA ColB -``` - -Check if string contains pattern -```shell -> 'hello' | str contains 'banana' -``` - -Check if list contains pattern -```shell -> [one two three] | str contains o -``` - -Check if list does not contain pattern -```shell -> [one two three] | str contains -n o -``` diff --git a/docs/commands/str_downcase.md b/docs/commands/str_downcase.md deleted file mode 100644 index 5b5b590841..0000000000 --- a/docs/commands/str_downcase.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str downcase -layout: command -version: 0.59.1 ---- - -downcases text - -## Signature - -```> str downcase ...rest``` - -## Parameters - - - `...rest`: optionally downcase text by column paths - -## Examples - -Downcase contents -```shell -> 'NU' | str downcase -``` - -Downcase contents -```shell -> 'TESTa' | str downcase -``` - -Downcase contents -```shell -> [[ColA ColB]; [Test ABC]] | str downcase ColA -``` - -Downcase contents -```shell -> [[ColA ColB]; [Test ABC]] | str downcase ColA ColB -``` diff --git a/docs/commands/str_ends-with.md b/docs/commands/str_ends-with.md deleted file mode 100644 index a4c4b4bc08..0000000000 --- a/docs/commands/str_ends-with.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: str ends-with -layout: command -version: 0.59.1 ---- - -checks if string ends with pattern - -## Signature - -```> str ends-with (pattern) ...rest``` - -## Parameters - - - `pattern`: the pattern to match - - `...rest`: optionally matches suffix of text by column paths - -## Examples - -Checks if string ends with '.rb' pattern -```shell -> 'my_library.rb' | str ends-with '.rb' -``` - -Checks if string ends with '.txt' pattern -```shell -> 'my_library.rb' | str ends-with '.txt' -``` diff --git a/docs/commands/str_find-replace.md b/docs/commands/str_find-replace.md deleted file mode 100644 index fcfe522462..0000000000 --- a/docs/commands/str_find-replace.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: str find-replace -layout: command -version: 0.59.1 ---- - -finds and replaces text - -## Signature - -```> str find-replace (find) (replace) ...rest --all``` - -## Parameters - - - `find`: the pattern to find - - `replace`: the replacement pattern - - `...rest`: optionally find and replace text by column paths - - `--all`: replace all occurrences of find string - -## Examples - -Find and replace contents with capture group -```shell -> 'my_library.rb' | str find-replace '(.+).rb' '$1.nu' -``` - -Find and replace all occurrences of find string -```shell -> 'abc abc abc' | str find-replace -a 'b' 'z' -``` - -Find and replace all occurrences of find string in table -```shell -> [[ColA ColB ColC]; [abc abc ads]] | str find-replace -a 'b' 'z' ColA ColC -``` diff --git a/docs/commands/str_index-of.md b/docs/commands/str_index-of.md deleted file mode 100644 index 212e554447..0000000000 --- a/docs/commands/str_index-of.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: str index-of -layout: command -version: 0.59.1 ---- - -Returns starting index of given pattern in string counting from 0. Returns -1 when there are no results. - -## Signature - -```> str index-of (pattern) ...rest --range --end``` - -## Parameters - - - `pattern`: the pattern to find index of - - `...rest`: optionally returns index of pattern in string by column paths - - `--range {any}`: optional start and/or end index - - `--end`: search from the end of the string - -## Examples - -Returns index of pattern in string -```shell -> 'my_library.rb' | str index-of '.rb' -``` - -Returns index of pattern in string with start index -```shell -> '.rb.rb' | str index-of '.rb' -r '1,' -``` - -Returns index of pattern in string with end index -```shell -> '123456' | str index-of '6' -r ',4' -``` - -Returns index of pattern in string with start and end index -```shell -> '123456' | str index-of '3' -r '1,4' -``` - -Alternatively you can use this form -```shell -> '123456' | str index-of '3' -r [1 4] -``` - -Returns index of pattern in string -```shell -> '/this/is/some/path/file.txt' | str index-of '/' -e -``` diff --git a/docs/commands/str_kebab-case.md b/docs/commands/str_kebab-case.md deleted file mode 100644 index eefd368700..0000000000 --- a/docs/commands/str_kebab-case.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str kebab-case -layout: command -version: 0.59.1 ---- - -converts a string to kebab-case - -## Signature - -```> str kebab-case ...rest``` - -## Parameters - - - `...rest`: optionally convert text to kebab-case by column paths - -## Examples - -convert a string to kebab-case -```shell -> 'NuShell' | str kebab-case -``` - -convert a string to kebab-case -```shell -> 'thisIsTheFirstCase' | str kebab-case -``` - -convert a string to kebab-case -```shell -> 'THIS_IS_THE_SECOND_CASE' | str kebab-case -``` - -convert a column from a table to kebab-case -```shell -> [[lang, gems]; [nuTest, 100]] | str kebab-case lang -``` diff --git a/docs/commands/str_length.md b/docs/commands/str_length.md deleted file mode 100644 index 42bcefbdbf..0000000000 --- a/docs/commands/str_length.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: str length -layout: command -version: 0.59.1 ---- - -outputs the lengths of the strings in the pipeline - -## Signature - -```> str length ...rest``` - -## Parameters - - - `...rest`: optionally find length of text by column paths - -## Examples - -Return the lengths of multiple strings -```shell -> 'hello' | str length -``` - -Return the lengths of multiple strings -```shell -> ['hi' 'there'] | str length -``` diff --git a/docs/commands/str_lpad.md b/docs/commands/str_lpad.md deleted file mode 100644 index 564ad3329e..0000000000 --- a/docs/commands/str_lpad.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: str lpad -layout: command -version: 0.59.1 ---- - -pad a string with a character a certain length - -## Signature - -```> str lpad ...rest --length --character``` - -## Parameters - - - `...rest`: optionally check if string contains pattern by column paths - - `--length {int}`: length to pad to - - `--character {string}`: character to pad with - -## Examples - -Left pad a string with a character a number of places -```shell -> 'nushell' | str lpad -l 10 -c '*' -``` - -Left pad a string with a character a number of places -```shell -> '123' | str lpad -l 10 -c '0' -``` - -Use lpad to truncate a string -```shell -> '123456789' | str lpad -l 3 -c '0' -``` - -Use lpad to pad Unicode -```shell -> '▉' | str lpad -l 10 -c '▉' -``` diff --git a/docs/commands/str_pascal-case.md b/docs/commands/str_pascal-case.md deleted file mode 100644 index 560c14f2c8..0000000000 --- a/docs/commands/str_pascal-case.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str pascal-case -layout: command -version: 0.59.1 ---- - -converts a string to PascalCase - -## Signature - -```> str pascal-case ...rest``` - -## Parameters - - - `...rest`: optionally convert text to PascalCase by column paths - -## Examples - -convert a string to PascalCase -```shell -> 'nu-shell' | str pascal-case -``` - -convert a string to PascalCase -```shell -> 'this-is-the-first-case' | str pascal-case -``` - -convert a string to PascalCase -```shell -> 'this_is_the_second_case' | str pascal-case -``` - -convert a column from a table to PascalCase -```shell -> [[lang, gems]; [nu_test, 100]] | str pascal-case lang -``` diff --git a/docs/commands/str_reverse.md b/docs/commands/str_reverse.md deleted file mode 100644 index 78b0fd3734..0000000000 --- a/docs/commands/str_reverse.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: str reverse -layout: command -version: 0.59.1 ---- - -outputs the reversals of the strings in the pipeline - -## Signature - -```> str reverse ...rest``` - -## Parameters - - - `...rest`: optionally reverse text by column paths - -## Examples - -Return the reversals of multiple strings -```shell -> 'Nushell' | str reverse -``` diff --git a/docs/commands/str_rpad.md b/docs/commands/str_rpad.md deleted file mode 100644 index f73e9a876c..0000000000 --- a/docs/commands/str_rpad.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: str rpad -layout: command -version: 0.59.1 ---- - -pad a string with a character a certain length - -## Signature - -```> str rpad ...rest --length --character``` - -## Parameters - - - `...rest`: optionally check if string contains pattern by column paths - - `--length {int}`: length to pad to - - `--character {string}`: character to pad with - -## Examples - -Right pad a string with a character a number of places -```shell -> 'nushell' | str rpad -l 10 -c '*' -``` - -Right pad a string with a character a number of places -```shell -> '123' | str rpad -l 10 -c '0' -``` - -Use rpad to truncate a string -```shell -> '123456789' | str rpad -l 3 -c '0' -``` - -Use rpad to pad Unicode -```shell -> '▉' | str rpad -l 10 -c '▉' -``` diff --git a/docs/commands/str_screaming-snake-case.md b/docs/commands/str_screaming-snake-case.md deleted file mode 100644 index b38f6ff9ed..0000000000 --- a/docs/commands/str_screaming-snake-case.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str screaming-snake-case -layout: command -version: 0.59.1 ---- - -converts a string to SCREAMING_SNAKE_CASE - -## Signature - -```> str screaming-snake-case ...rest``` - -## Parameters - - - `...rest`: optionally convert text to SCREAMING_SNAKE_CASE by column paths - -## Examples - -convert a string to camelCase -```shell -> "NuShell" | str screaming-snake-case -``` - -convert a string to camelCase -```shell -> "this_is_the_second_case" | str screaming-snake-case -``` - -convert a string to camelCase -```shell -> "this-is-the-first-case" | str screaming-snake-case -``` - -convert a column from a table to SCREAMING_SNAKE_CASE -```shell -> [[lang, gems]; [nu_test, 100]] | str screaming-snake-case lang -``` diff --git a/docs/commands/str_snake-case.md b/docs/commands/str_snake-case.md deleted file mode 100644 index 245203f45c..0000000000 --- a/docs/commands/str_snake-case.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: str snake-case -layout: command -version: 0.59.1 ---- - -converts a string to snake_case - -## Signature - -```> str snake-case ...rest``` - -## Parameters - - - `...rest`: optionally convert text to snake_case by column paths - -## Examples - -convert a string to camelCase -```shell -> "NuShell" | str snake-case -``` - -convert a string to camelCase -```shell -> "this_is_the_second_case" | str snake-case -``` - -convert a string to camelCase -```shell -> "this-is-the-first-case" | str snake-case -``` - -convert a column from a table to snake-case -```shell -> [[lang, gems]; [nuTest, 100]] | str snake-case lang -``` diff --git a/docs/commands/str_starts-with.md b/docs/commands/str_starts-with.md deleted file mode 100644 index 5e17457623..0000000000 --- a/docs/commands/str_starts-with.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: str starts-with -layout: command -version: 0.59.1 ---- - -checks if string starts with pattern - -## Signature - -```> str starts-with (pattern) ...rest``` - -## Parameters - - - `pattern`: the pattern to match - - `...rest`: optionally matches prefix of text by column paths - -## Examples - -Checks if string starts with 'my' pattern -```shell -> 'my_library.rb' | str starts-with 'my' -``` - -Checks if string starts with 'my' pattern -```shell -> 'Cargo.toml' | str starts-with 'Car' -``` - -Checks if string starts with 'my' pattern -```shell -> 'Cargo.toml' | str starts-with '.toml' -``` diff --git a/docs/commands/str_substring.md b/docs/commands/str_substring.md deleted file mode 100644 index 05029f6790..0000000000 --- a/docs/commands/str_substring.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: str substring -layout: command -version: 0.59.1 ---- - -substrings text - -## Signature - -```> str substring (range) ...rest``` - -## Parameters - - - `range`: the indexes to substring [start end] - - `...rest`: optionally substring text by column paths - -## Examples - -Get a substring from the text -```shell -> 'good nushell' | str substring [5 12] -``` - -Alternatively, you can use the form -```shell -> 'good nushell' | str substring '5,12' -``` - -Drop the last `n` characters from the string -```shell -> 'good nushell' | str substring ',-5' -``` - -Get the remaining characters from a starting index -```shell -> 'good nushell' | str substring '5,' -``` - -Get the characters from the beginning until ending index -```shell -> 'good nushell' | str substring ',7' -``` diff --git a/docs/commands/str_to-datetime.md b/docs/commands/str_to-datetime.md deleted file mode 100644 index 2dd4016900..0000000000 --- a/docs/commands/str_to-datetime.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: str to-datetime -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> str to-datetime ``` diff --git a/docs/commands/str_to-decimal.md b/docs/commands/str_to-decimal.md deleted file mode 100644 index e9d714b123..0000000000 --- a/docs/commands/str_to-decimal.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: str to-decimal -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> str to-decimal ``` diff --git a/docs/commands/str_to-int.md b/docs/commands/str_to-int.md deleted file mode 100644 index 2d5181069a..0000000000 --- a/docs/commands/str_to-int.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: str to-int -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> str to-int ``` diff --git a/docs/commands/str_trim.md b/docs/commands/str_trim.md deleted file mode 100644 index cf3342d690..0000000000 --- a/docs/commands/str_trim.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: str trim -layout: command -version: 0.59.1 ---- - -trims text - -## Signature - -```> str trim ...rest --char --left --right --all --both --format``` - -## Parameters - - - `...rest`: optionally trim text by column paths - - `--char {string}`: character to trim (default: whitespace) - - `--left`: trims characters only from the beginning of the string (default: whitespace) - - `--right`: trims characters only from the end of the string (default: whitespace) - - `--all`: trims all characters from both sides of the string *and* in the middle (default: whitespace) - - `--both`: trims all characters from left and right side of the string (default: whitespace) - - `--format`: trims spaces replacing multiple characters with singles in the middle (default: whitespace) - -## Examples - -Trim whitespace -```shell -> 'Nu shell ' | str trim -``` - -Trim a specific character -```shell -> '=== Nu shell ===' | str trim -c '=' | str trim -``` - -Trim all characters -```shell -> ' Nu shell ' | str trim -a -``` - -Trim whitespace from the beginning of string -```shell -> ' Nu shell ' | str trim -l -``` - -Trim a specific character -```shell -> '=== Nu shell ===' | str trim -c '=' -``` - -Trim whitespace from the end of string -```shell -> ' Nu shell ' | str trim -r -``` - -Trim a specific character -```shell -> '=== Nu shell ===' | str trim -r -c '=' -``` diff --git a/docs/commands/str_upcase.md b/docs/commands/str_upcase.md deleted file mode 100644 index a609adef9f..0000000000 --- a/docs/commands/str_upcase.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: str upcase -layout: command -version: 0.59.1 ---- - -upcases text - -## Signature - -```> str upcase ...rest``` - -## Parameters - - - `...rest`: optionally upcase text by column paths - -## Examples - -Upcase contents -```shell -> 'nu' | str upcase -``` diff --git a/docs/commands/sys.md b/docs/commands/sys.md deleted file mode 100644 index c739a10ca8..0000000000 --- a/docs/commands/sys.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: sys -layout: command -version: 0.59.1 ---- - -View information about the system. - -## Signature - -```> sys ``` - -## Examples - -Show info about the system -```shell -> sys -``` - -Show the os system name with get -```shell -> (sys).host | get name -``` - -Show the os system name -```shell -> (sys).host.name -``` diff --git a/docs/commands/table.md b/docs/commands/table.md deleted file mode 100644 index df46de6ff3..0000000000 --- a/docs/commands/table.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: table -layout: command -version: 0.59.1 ---- - -Render the table. - -## Signature - -```> table --start-number``` - -## Parameters - - - `--start-number {int}`: row number to start viewing from - -## Examples - -List the files in current directory with index number start from 1. -```shell -> ls | table -n 1 -``` - -Render data in table view -```shell -> echo [[a b]; [1 2] [3 4]] | table -``` diff --git a/docs/commands/term_size.md b/docs/commands/term_size.md deleted file mode 100644 index a48121d9c5..0000000000 --- a/docs/commands/term_size.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: term size -layout: command -version: 0.59.1 ---- - -Returns the terminal size - -## Signature - -```> term size --columns --rows``` - -## Parameters - - - `--columns`: Report only the width of the terminal - - `--rows`: Report only the height of the terminal - -## Examples - -Return the width height of the terminal -```shell -> term size -``` - -Return the width (columns) of the terminal -```shell -> term size -c -``` - -Return the height (rows) of the terminal -```shell -> term size -r -``` diff --git a/docs/commands/to.md b/docs/commands/to.md deleted file mode 100644 index 91d70a369c..0000000000 --- a/docs/commands/to.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: to -layout: command -version: 0.59.1 ---- - -Translate structured data to a format - -## Signature - -```> to ``` diff --git a/docs/commands/to_csv.md b/docs/commands/to_csv.md deleted file mode 100644 index 5976bb13a2..0000000000 --- a/docs/commands/to_csv.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: to csv -layout: command -version: 0.59.1 ---- - -Convert table into .csv text - -## Signature - -```> to csv --separator --noheaders``` - -## Parameters - - - `--separator {string}`: a character to separate columns, defaults to ',' - - `--noheaders`: do not output the columns names as the first row - -## Examples - -Outputs an CSV string representing the contents of this table -```shell -> [[foo bar]; [1 2]] | to csv -``` - -Outputs an CSV string representing the contents of this table -```shell -> [[foo bar]; [1 2]] | to csv -s ';' -``` diff --git a/docs/commands/to_html.md b/docs/commands/to_html.md deleted file mode 100644 index 79c110733e..0000000000 --- a/docs/commands/to_html.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: to html -layout: command -version: 0.59.1 ---- - -Convert table into simple HTML - -## Signature - -```> to html --html-color --no-color --dark --partial --theme --list``` - -## Parameters - - - `--html-color`: change ansi colors to html colors - - `--no-color`: remove all ansi colors in output - - `--dark`: indicate your background color is a darker color - - `--partial`: only output the html for the content itself - - `--theme {string}`: the name of the theme to use (github, blulocolight, ...) - - `--list`: list the names of all available themes - -## Examples - -Outputs an HTML string representing the contents of this table -```shell -> [[foo bar]; [1 2]] | to html -``` - -Optionally, only output the html for the content itself -```shell -> [[foo bar]; [1 2]] | to html --partial -``` - -Optionally, output the string with a dark background -```shell -> [[foo bar]; [1 2]] | to html --dark -``` diff --git a/docs/commands/to_json.md b/docs/commands/to_json.md deleted file mode 100644 index 92ea3cea8b..0000000000 --- a/docs/commands/to_json.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: to json -layout: command -version: 0.59.1 ---- - -Converts table data into JSON text. - -## Signature - -```> to json --raw --indent --tabs``` - -## Parameters - - - `--raw`: remove all of the whitespace - - `--indent {number}`: specify indentation width - - `--tabs {number}`: specify indentation tab quantity - -## Examples - -Outputs a JSON string, with default indentation, representing the contents of this table -```shell -> [a b c] | to json -``` - -Outputs a JSON string, with 4-space indentation, representing the contents of this table -```shell -> [Joe Bob Sam] | to json -i 4 -``` - -Outputs an unformatted JSON string representing the contents of this table -```shell -> [1 2 3] | to json -r -``` diff --git a/docs/commands/to_md.md b/docs/commands/to_md.md deleted file mode 100644 index 2e596b75ae..0000000000 --- a/docs/commands/to_md.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: to md -layout: command -version: 0.59.1 ---- - -Convert table into simple Markdown - -## Signature - -```> to md --pretty --per-element``` - -## Parameters - - - `--pretty`: Formats the Markdown table to vertically align items - - `--per-element`: treat each row as markdown syntax element - -## Examples - -Outputs an MD string representing the contents of this table -```shell -> [[foo bar]; [1 2]] | to md -``` - -Optionally, output a formatted markdown string -```shell -> [[foo bar]; [1 2]] | to md --pretty -``` - -Treat each row as a markdown element -```shell -> [{"H1": "Welcome to Nushell" } [[foo bar]; [1 2]]] | to md --per-element --pretty -``` diff --git a/docs/commands/to_nuon.md b/docs/commands/to_nuon.md deleted file mode 100644 index ce4c19e0ea..0000000000 --- a/docs/commands/to_nuon.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: to nuon -layout: command -version: 0.59.1 ---- - -Converts table data into Nuon (Nushell Object Notation) text. - -## Signature - -```> to nuon ``` - -## Examples - -Outputs a nuon string representing the contents of this table -```shell -> [1 2 3] | to nuon -``` diff --git a/docs/commands/to_toml.md b/docs/commands/to_toml.md deleted file mode 100644 index 4dad27601d..0000000000 --- a/docs/commands/to_toml.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: to toml -layout: command -version: 0.59.1 ---- - -Convert table into .toml text - -## Signature - -```> to toml ``` - -## Examples - -Outputs an TOML string representing the contents of this table -```shell -> [[foo bar]; ["1" "2"]] | to toml -``` diff --git a/docs/commands/to_tsv.md b/docs/commands/to_tsv.md deleted file mode 100644 index 707286542c..0000000000 --- a/docs/commands/to_tsv.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: to tsv -layout: command -version: 0.59.1 ---- - -Convert table into .tsv text - -## Signature - -```> to tsv --noheaders``` - -## Parameters - - - `--noheaders`: do not output the column names as the first row - -## Examples - -Outputs an TSV string representing the contents of this table -```shell -> [[foo bar]; [1 2]] | to tsv -``` diff --git a/docs/commands/to_url.md b/docs/commands/to_url.md deleted file mode 100644 index 6a21f231b6..0000000000 --- a/docs/commands/to_url.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: to url -layout: command -version: 0.59.1 ---- - -Convert table into url-encoded text - -## Signature - -```> to url ``` - -## Examples - -Outputs an URL string representing the contents of this table -```shell -> [[foo bar]; ["1" "2"]] | to url -``` diff --git a/docs/commands/to_xml.md b/docs/commands/to_xml.md deleted file mode 100644 index 2a13807ef7..0000000000 --- a/docs/commands/to_xml.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: to xml -layout: command -version: 0.59.1 ---- - -Convert table into .xml text - -## Signature - -```> to xml --pretty``` - -## Parameters - - - `--pretty {int}`: Formats the XML text with the provided indentation setting - -## Examples - -Outputs an XML string representing the contents of this table -```shell -> { "note": { "children": [{ "remember": {"attributes" : {}, "children": [Event]}}], "attributes": {} } } | to xml -``` - -Optionally, formats the text with a custom indentation setting -```shell -> { "note": { "children": [{ "remember": {"attributes" : {}, "children": [Event]}}], "attributes": {} } } | to xml -p 3 -``` diff --git a/docs/commands/to_yaml.md b/docs/commands/to_yaml.md deleted file mode 100644 index 077ac31267..0000000000 --- a/docs/commands/to_yaml.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: to yaml -layout: command -version: 0.59.1 ---- - -Convert table into .yaml/.yml text - -## Signature - -```> to yaml ``` - -## Examples - -Outputs an YAML string representing the contents of this table -```shell -> [[foo bar]; ["1" "2"]] | to yaml -``` diff --git a/docs/commands/touch.md b/docs/commands/touch.md deleted file mode 100644 index 99f676648c..0000000000 --- a/docs/commands/touch.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: touch -layout: command -version: 0.59.1 ---- - -Creates one or more files. - -## Signature - -```> touch (filename) ...rest``` - -## Parameters - - - `filename`: the path of the file you want to create - - `...rest`: additional files to create - -## Examples - -Creates "fixture.json" -```shell -> touch fixture.json -``` - -Creates files a, b and c -```shell -> touch a b c -``` diff --git a/docs/commands/transpose.md b/docs/commands/transpose.md deleted file mode 100644 index a4f9b81baf..0000000000 --- a/docs/commands/transpose.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: transpose -layout: command -version: 0.59.1 ---- - -Transposes the table contents so rows become columns and columns become rows. - -## Signature - -```> transpose ...rest --header-row --ignore-titles``` - -## Parameters - - - `...rest`: the names to give columns once transposed - - `--header-row`: treat the first row as column names - - `--ignore-titles`: don't transpose the column names into values - -## Examples - -Transposes the table contents with default column names -```shell -> echo [[c1 c2]; [1 2]] | transpose -``` - -Transposes the table contents with specified column names -```shell -> echo [[c1 c2]; [1 2]] | transpose key val -``` - -Transposes the table without column names and specify a new column name -```shell -> echo [[c1 c2]; [1 2]] | transpose -i val -``` diff --git a/docs/commands/tutor.md b/docs/commands/tutor.md deleted file mode 100644 index 47a88eeb8e..0000000000 --- a/docs/commands/tutor.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: tutor -layout: command -version: 0.59.1 ---- - -Run the tutorial. To begin, run: tutor - -## Signature - -```> tutor (search) --find``` - -## Parameters - - - `search`: item to search for, or 'list' to list available tutorials - - `--find {string}`: Search tutorial for a phrase - -## Examples - -Begin the tutorial -```shell -> tutor begin -``` - -Search a tutorial by phrase -```shell -> tutor -f "$in" -``` diff --git a/docs/commands/unalias.md b/docs/commands/unalias.md deleted file mode 100644 index 9ab2af9351..0000000000 --- a/docs/commands/unalias.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: unalias -layout: command -version: 0.59.1 ---- - -Deprecated command - -## Signature - -```> unalias ``` diff --git a/docs/commands/uniq.md b/docs/commands/uniq.md deleted file mode 100644 index 35addd7404..0000000000 --- a/docs/commands/uniq.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: uniq -layout: command -version: 0.59.1 ---- - -Return the unique rows. - -## Signature - -```> uniq --count --repeated --ignore-case --unique``` - -## Parameters - - - `--count`: Count the unique rows - - `--repeated`: Count the rows that has more than one value - - `--ignore-case`: Ignore differences in case when comparing - - `--unique`: Only return unique values - -## Examples - -Remove duplicate rows of a list/table -```shell -> [2 3 3 4] | uniq -``` - -Only print duplicate lines, one for each group -```shell -> [1 2 2] | uniq -d -``` - -Only print unique lines lines -```shell -> [1 2 2] | uniq -u -``` - -Ignore differences in case when comparing -```shell -> ['hello' 'goodbye' 'Hello'] | uniq -i -``` - -Remove duplicate rows and show counts of a list/table -```shell -> [1 2 2] | uniq -c -``` diff --git a/docs/commands/update.md b/docs/commands/update.md deleted file mode 100644 index 30f6e2e2c0..0000000000 --- a/docs/commands/update.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: update -layout: command -version: 0.59.1 ---- - -Update an existing column to have a new value. - -## Signature - -```> update (field) (replacement value)``` - -## Parameters - - - `field`: the name of the column to update - - `replacement value`: the new value to give the cell(s) - -## Examples - -Update a column value -```shell -> echo {'name': 'nu', 'stars': 5} | update name 'Nushell' -``` - -Use in block form for more involved updating logic -```shell -> echo [[count fruit]; [1 'apple']] | update count {|f| $f.count + 1} -``` - -Use in block form for more involved updating logic -```shell -> echo [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { get authors | str collect ',' } -``` diff --git a/docs/commands/update_cells.md b/docs/commands/update_cells.md deleted file mode 100644 index ed7156fdb4..0000000000 --- a/docs/commands/update_cells.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: update cells -layout: command -version: 0.59.1 ---- - -Update the table cells. - -## Signature - -```> update cells (block) --columns``` - -## Parameters - - - `block`: the block to run an update for each cell - - `--columns {table}`: list of columns to update - -## Examples - -Update the zero value cells to empty strings. -```shell -> [ - ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; - [ 37, 0, 0, 0, 37, 0, 0] -] | update cells {|value| - if $value == 0 { - "" - } else { - $value - } -} -``` - -Update the zero value cells to empty strings in 2 last columns. -```shell -> [ - ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; - [ 37, 0, 0, 0, 37, 0, 0] -] | update cells -c ["2021-11-18", "2021-11-17"] {|value| - if $value == 0 { - "" - } else { - $value - } -} -``` diff --git a/docs/commands/url.md b/docs/commands/url.md deleted file mode 100644 index 74a068be4b..0000000000 --- a/docs/commands/url.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: url -layout: command -version: 0.59.1 ---- - -Apply url function. - -## Signature - -```> url ``` diff --git a/docs/commands/url_host.md b/docs/commands/url_host.md deleted file mode 100644 index f68180e4b0..0000000000 --- a/docs/commands/url_host.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: url host -layout: command -version: 0.59.1 ---- - -gets the host of a url - -## Signature - -```> url host ...rest``` - -## Parameters - - - `...rest`: optionally operate by cell path - -## Examples - -Get host of a url -```shell -> echo 'http://www.example.com/foo/bar' | url host -``` diff --git a/docs/commands/url_path.md b/docs/commands/url_path.md deleted file mode 100644 index c53460e89f..0000000000 --- a/docs/commands/url_path.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: url path -layout: command -version: 0.59.1 ---- - -gets the path of a url - -## Signature - -```> url path ...rest``` - -## Parameters - - - `...rest`: optionally operate by cell path - -## Examples - -Get path of a url -```shell -> echo 'http://www.example.com/foo/bar' | url path -``` - -A trailing slash will be reflected in the path -```shell -> echo 'http://www.example.com' | url path -``` diff --git a/docs/commands/url_query.md b/docs/commands/url_query.md deleted file mode 100644 index ff621078a4..0000000000 --- a/docs/commands/url_query.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: url query -layout: command -version: 0.59.1 ---- - -gets the query of a url - -## Signature - -```> url query ...rest``` - -## Parameters - - - `...rest`: optionally operate by cell path - -## Examples - -Get query of a url -```shell -> echo 'http://www.example.com/?foo=bar&baz=quux' | url query -``` - -No query gives the empty string -```shell -> echo 'http://www.example.com/' | url query -``` diff --git a/docs/commands/url_scheme.md b/docs/commands/url_scheme.md deleted file mode 100644 index ed44fce259..0000000000 --- a/docs/commands/url_scheme.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: url scheme -layout: command -version: 0.59.1 ---- - -gets the scheme (eg http, file) of a url - -## Signature - -```> url scheme ...rest``` - -## Parameters - - - `...rest`: optionally operate by cell path - -## Examples - -Get scheme of a url -```shell -> echo 'http://www.example.com' | url scheme -``` - -You get an empty string if there is no scheme -```shell -> echo 'test' | url scheme -``` diff --git a/docs/commands/use.md b/docs/commands/use.md deleted file mode 100644 index 1b15cb2119..0000000000 --- a/docs/commands/use.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: use -layout: command -version: 0.59.1 ---- - -Use definitions from a module - -## Signature - -```> use (pattern)``` - -## Parameters - - - `pattern`: import pattern - -## Examples - -Define a custom command in a module and call it -```shell -> module spam { export def foo [] { "foo" } }; use spam foo; foo -``` - -Define an environment variable in a module and evaluate it -```shell -> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV -``` - -Define a custom command that participates in the environment in a module and call it -```shell -> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR -``` diff --git a/docs/commands/version.md b/docs/commands/version.md deleted file mode 100644 index 0f49754a08..0000000000 --- a/docs/commands/version.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: version -layout: command -version: 0.59.1 ---- - -Display Nu version. - -## Signature - -```> version ``` - -## Examples - -Display Nu version -```shell -> version -``` diff --git a/docs/commands/view-source.md b/docs/commands/view-source.md deleted file mode 100644 index 82694da1e2..0000000000 --- a/docs/commands/view-source.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: view-source -layout: command -version: 0.59.1 ---- - -View a block, module, or a definition - -## Signature - -```> view-source (item)``` - -## Parameters - - - `item`: name or block to view - -## Examples - -View the source of a code block -```shell -> let abc = { echo 'hi' }; view-source $abc -``` - -View the source of a custom command -```shell -> def hi [] { echo 'Hi!' }; view-source hi -``` - -View the source of a custom command, which participates in the caller environment -```shell -> def-env foo [] { let-env BAR = 'BAZ' }; view-source foo -``` - -View the source of a module -```shell -> module mod-foo { export env FOO_ENV { 'BAZ' } }; view-source mod-foo -``` diff --git a/docs/commands/where.md b/docs/commands/where.md deleted file mode 100644 index 4531a7e8bb..0000000000 --- a/docs/commands/where.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: where -layout: command -version: 0.59.1 ---- - -Filter values based on a condition. - -## Signature - -```> where (cond)``` - -## Parameters - - - `cond`: condition - -## Examples - -List all files in the current directory with sizes greater than 2kb -```shell -> ls | where size > 2kb -``` - -List only the files in the current directory -```shell -> ls | where type == file -``` - -List all files with names that contain "Car" -```shell -> ls | where name =~ "Car" -``` - -List all files that were modified in the last two weeks -```shell -> ls | where modified >= (date now) - 2wk -``` diff --git a/docs/commands/which.md b/docs/commands/which.md deleted file mode 100644 index 4949729b80..0000000000 --- a/docs/commands/which.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: which -layout: command -version: 0.59.1 ---- - -Finds a program file, alias or custom command. - -## Signature - -```> which (application) ...rest --all``` - -## Parameters - - - `application`: application - - `...rest`: additional applications - - `--all`: list all executables - -## Examples - -Find if the 'myapp' application is available -```shell -> which myapp -``` diff --git a/docs/commands/window.md b/docs/commands/window.md deleted file mode 100644 index ffaaa6e788..0000000000 --- a/docs/commands/window.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: window -layout: command -version: 0.59.1 ---- - -Creates a sliding window of `window_size` that slide by n rows/elements across input. - -## Signature - -```> window (window_size) --stride``` - -## Parameters - - - `window_size`: the size of each window - - `--stride {int}`: the number of rows to slide over between windows - -## Examples - -A sliding window of two elements -```shell -> echo [1 2 3 4] | window 2 -``` - -A sliding window of two elements, with a stride of 3 -```shell -> [1, 2, 3, 4, 5, 6, 7, 8] | window 2 --stride 3 -``` diff --git a/docs/commands/with-env.md b/docs/commands/with-env.md deleted file mode 100644 index 1e562bc945..0000000000 --- a/docs/commands/with-env.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: with-env -layout: command -version: 0.59.1 ---- - -Runs a block with an environment variable set. - -## Signature - -```> with-env (variable) (block)``` - -## Parameters - - - `variable`: the environment variable to temporarily set - - `block`: the block to run once the variable is set - -## Examples - -Set the MYENV environment variable -```shell -> with-env [MYENV "my env value"] { $env.MYENV } -``` - -Set by primitive value list -```shell -> with-env [X Y W Z] { $env.X } -``` - -Set by single row table -```shell -> with-env [[X W]; [Y Z]] { $env.W } -``` - -Set by row(e.g. `open x.json` or `from json`) -```shell -> echo '{"X":"Y","W":"Z"}'|from json|with-env $in { echo $env.X $env.W } -``` diff --git a/docs/commands/wrap.md b/docs/commands/wrap.md deleted file mode 100644 index 1872dfedd2..0000000000 --- a/docs/commands/wrap.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: wrap -layout: command -version: 0.59.1 ---- - -Wrap the value into a column. - -## Signature - -```> wrap (name)``` - -## Parameters - - - `name`: the name of the column - -## Examples - -Wrap a list into a table with a given column name -```shell -> echo [1 2 3] | wrap num -``` diff --git a/docs/commands/zip.md b/docs/commands/zip.md deleted file mode 100644 index 4de2feb118..0000000000 --- a/docs/commands/zip.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: zip -layout: command -version: 0.59.1 ---- - -Combine a stream with the input - -## Signature - -```> zip (other)``` - -## Parameters - - - `other`: the other input - -## Examples - -Zip multiple streams and get one of the results -```shell -> 1..3 | zip 4..6 -```