github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/ja.md (about)

     1  # `ja` (mkarray)
     2  
     3  > A sophisticated yet simply way to build a JSON array
     4  
     5  ## Description
     6  
     7  Murex has a pretty sophisticated builtin for generating JSON arrays.
     8  It works a little bit like Bash's `{1..9}` syntax but includes a few
     9  additional nifty features.
    10  
    11  **Please note that while this builtin is not marked for deprecation, it has
    12  been superseded by the `%[]` tokens.** ([read more](../parser/create-array.md))
    13  
    14  ## Usage
    15  
    16  ```
    17  ja [start..end] -> <stdout>
    18  ja [start..end.base] -> <stdout>
    19  ja [start..end,start..end] -> <stdout>
    20  ja [start..end][start..end] -> <stdout>
    21  ```
    22  
    23  ## Examples
    24  
    25  ```
    26  » ja [1..5]
    27  [
    28      "1",
    29      "2",
    30      "3",
    31      "4",
    32      "5"
    33  ]
    34  ```
    35  
    36  ```
    37  » ja [Monday..Sunday]
    38  [
    39      "Monday",
    40      "Tuesday",
    41      "Wednesday",
    42      "Thursday",
    43      "Friday",
    44      "Saturday",
    45      "Sunday"
    46  ]
    47  ```
    48  
    49  Please note that as per the first example, all arrays generated by `ja` are
    50  arrays of strings - even if you're command is ranging over integers.
    51  
    52  ## Detail
    53  
    54  Please read the documentation on `a` for a more detailed breakdown on of
    55  `ja`'s supported features.
    56  
    57  ## See Also
    58  
    59  * [`%[]` Create Array](../parser/create-array.md):
    60    Quickly generate arrays
    61  * [`[ ..Range ]`](../parser/range.md):
    62    Outputs a ranged subset of data from STDIN
    63  * [`[ Index ]`](../parser/item-index.md):
    64    Outputs an element from an array, map or table
    65  * [`[[ Element ]]`](../parser/element.md):
    66    Outputs an element from a nested structure
    67  * [`a` (mkarray)](../commands/a.md):
    68    A sophisticated yet simple way to build an array or list
    69  * [`count`](../commands/count.md):
    70    Count items in a map, list or array
    71  * [`json`](../types/json.md):
    72    JavaScript Object Notation (JSON)
    73  * [`mtac`](../commands/mtac.md):
    74    Reverse the order of an array
    75  * [`ta` (mkarray)](../commands/ta.md):
    76    A sophisticated yet simple way to build an array of a user defined data-type
    77  
    78  <hr/>
    79  
    80  This document was generated from [builtins/core/mkarray/array_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/mkarray/array_doc.yaml).