mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 23:07:46 +02:00
Auto-generate markdown command docs (#4451)
* Finish updating * a couple improvements * Update renames * cleanup examples
This commit is contained in:
47
docs/commands/update_cells.md
Normal file
47
docs/commands/update_cells.md
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
title: update cells
|
||||
layout: command
|
||||
version: 0.59.0
|
||||
---
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user