github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/tabulate.md (about) 1 # `tabulate` 2 3 > Table transformation tools 4 5 ## Description 6 7 `tabluate` is a swiss army knife for table transforming human readable tables 8 into machine readable data structure. 9 10 > Please note that this builtin is still in active development and the default 11 > behavior will continue to change and evolve. Any features marked with a flag 12 > (see below) will be stable, have numerous tests written against them, and 13 > thus safe to use. 14 15 ## Usage 16 17 ``` 18 <stdin> -> tabulate [ flags ] -> <stdout> 19 ``` 20 21 ## Flags 22 23 * `--column-wraps` 24 Boolean, used with --map or --key-value to merge trailing lines if the text wraps within the same column 25 * `--help` 26 Boolean, displays a list of flags 27 * `--joiner` 28 String, used with --map to concatenate any trailing records in a given field 29 * `--key-inc-hint` 30 Boolean, used with --map to split any space or equal delimited hints/examples (eg parsing flags) 31 * `--key-value` 32 Boolean, discard any records that don't appear key value pairs (auto-enabled when --map used) 33 * `--map` 34 Boolean, return JSON map instead of table 35 * `--separator` 36 'String, custom regex pattern for spliting fields (default: `(\t|\s[\s]+)+`)' 37 * `--split-comma` 38 Boolean, split first field and duplicate the line if comma found in first field (eg parsing flags in help pages) 39 * `--split-space` 40 Boolean, split first field and duplicate the line if white space found in first field (eg parsing flags in help pages) 41 42 ## Detail 43 44 ### Dynamic Autocompletion 45 46 Because `tabulate` is designed to parse human readable tables, it is used a lot 47 for dynamically turning command like program help output into JSON maps for 48 `autocomplete`'s **DynamicDesc** blocks: 49 50 ``` 51 rsync --help -> @[^Options$..--help]re -> tabulate --map --split-comma --column-wraps --key-inc-hint 52 ``` 53 54 ## See Also 55 56 * [`[ Index ]`](../parser/item-index.md): 57 Outputs an element from an array, map or table 58 * [`[[ Element ]]`](../parser/element.md): 59 Outputs an element from a nested structure 60 * [`autocomplete`](../commands/autocomplete.md): 61 Set definitions for tab-completion in the command line 62 * [`formap`](../commands/formap.md): 63 Iterate through a map or other collection of data 64 * [`format`](../commands/format.md): 65 Reformat one data-type into another data-type 66 67 <hr/> 68 69 This document was generated from [builtins/core/tabulate/tabulate_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/tabulate/tabulate_doc.yaml).