# edit

> Replace the value of a cell specified by its row and column.

**[Table of Contents](TableOfContents.md)** | **Source: [src/cmd/edit.rs](https://github.com/dathere/qsv/blob/master/src/cmd/edit.rs)**

<a name="nav"></a>
[Description](#description) | [Examples](#examples) | [Usage](#usage) | [Edit Options](#edit-options) | [Common Options](#common-options)

<a name="description"></a>

## Description [↩](#nav)

Replace the value of a cell specified by its row and column.


<a name="examples"></a>

## Examples [↩](#nav)

items.csv
```csv
item,color
shoes,blue
flashlight,gray
```

> To output the data with the color of the shoes as green instead of blue

```console
qsv edit items.csv color 0 green
```

```csv
item,color
shoes,green
flashlight,gray
```

You may also choose to specify the column name by its index (in this case 1).
Specifying a column as a number is prioritized by index rather than name.
If there is no newline (\n) at the end of the input data, it may be added to the output.
See also <https://github.com/dathere/qsv/wiki/Transform-and-Reshape#edit>

<a name="usage"></a>

## Usage [↩](#nav)

```console
qsv edit [options] <input> <column> <row> <value>
qsv edit --help
```

<a name="edit-options"></a>

## Edit Options [↩](#nav)

| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Type | Description | Default |
|--------|------|-------------|--------|
| &nbsp;`‑i,`<br>`‑‑in‑place`&nbsp; | flag | Overwrite the input file data with the output. The input file is renamed to a .bak file in the same directory. If the .bak file already exists, the command errors instead of overwriting it. Symbolic links are rejected; pass the resolved path instead. (Other Windows reparse points such as junction points are not detected.) |  |

<a name="common-options"></a>

## Common Options [↩](#nav)

| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Type | Description | Default |
|--------|------|-------------|--------|
| &nbsp;`‑h,`<br>`‑‑help`&nbsp; | flag | Display this message |  |
| &nbsp;`‑o,`<br>`‑‑output`&nbsp; | string | Write output to <file> instead of stdout. |  |
| &nbsp;`‑n,`<br>`‑‑no‑headers`&nbsp; | flag | Start row indices from the header row as 0 (allows editing the header row). |  |

---
**Source:** [`src/cmd/edit.rs`](https://github.com/dathere/qsv/blob/master/src/cmd/edit.rs)
| **[Table of Contents](TableOfContents.md)** | **[README](../../README.md)**
