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