2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: transpose
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
## 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
|
|
|
|
```
|