nushell/crates/nu-command/src/strings
nome 5101b5e306
Add --number flag to split column (#13831)
This allows parsing of data (e.g. key-value pairs) where the last column
may contain the delimiter.

- this PR should close #13742

# Description

Adds a `--number (-n)` flag to `split column`, analogous to `split row
--number`.

```
~> ['author: Salina Yoon' r#'title: Where's Ellie?: A Hide-and-Seek Book'#] | split column --number 2 ': ' key value
╭───┬────────┬──────────────────────────────────────╮
│ # │  key   │                value                 │
├───┼────────┼──────────────────────────────────────┤
│ 0 │ author │ Salina Yoon                          │
│ 1 │ title  │ Where's Ellie?: A Hide-and-Seek Book │
╰───┴────────┴──────────────────────────────────────╯
```

# User-Facing Changes
* `split column` gains a `--number` option

# Tests + Formatting
Tests included in strings::split::column::test::test_examples and
commands::split_column::to_column.

# After Submitting
Reference documentation is auto-generated from code. No other
documentation updates necessary.
2024-09-12 07:16:33 -05:00
..
base Fix encode/decode todo's (#13683) 2024-08-24 09:02:02 -05:00
encode_decode Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
format Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
split Add --number flag to split column (#13831) 2024-09-12 07:16:33 -05:00
str_ Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
char_.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
detect_columns.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
guess_width.rs Don't panic on detect columns with --guess flag (#13752) 2024-09-02 16:29:53 +02:00
mod.rs encode/decode for multiple alphabets (#13428) 2024-08-23 11:18:51 -05:00
parse.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00