Skip to content

Commit

Permalink
sort-within-records doc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Nov 29, 2020
1 parent 5bb5147 commit 5a453f8
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
57 changes: 57 additions & 0 deletions docs/reference-verbs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,63 @@ were encountered, regardless of the specified sort order:
x=1
a=3

.. _reference-verbs-sort-within-records:

sort-within-records
----------------------------------------------------------------

::

$ mlr sort-within-records -h
Usage: mlr sort-within-records [no options]
Outputs records sorted lexically ascending by keys.

::

$ cat data/sort-within-records.json
{
"a": 1,
"b": 2,
"c": 3
}
{
"b": 4,
"a": 5,
"c": 6
}
{
"c": 7,
"b": 8,
"a": 9
}

::

$ mlr --ijson --opprint cat data/sort-within-records.json
a b c
1 2 3
b a c
4 5 6
c b a
7 8 9

::

$ mlr --json sort-within-records data/sort-within-records.json
{ "a": 1, "b": 2, "c": 3 }
{ "a": 5, "b": 4, "c": 6 }
{ "a": 9, "b": 8, "c": 7 }

::

$ mlr --ijson --opprint sort-within-records data/sort-within-records.json
a b c
1 2 3
5 4 6
9 8 7

.. _reference-verbs-stats1:

stats1
Expand Down
25 changes: 25 additions & 0 deletions docs/reference-verbs.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,31 @@ POKI_RUN_COMMAND{{mlr sort -n x data/sort-missing.dkvp}}HERE

POKI_RUN_COMMAND{{mlr sort -nr x data/sort-missing.dkvp}}HERE

.. _reference-verbs-sort-within-records:

sort-within-records
----------------------------------------------------------------

::

POKI_RUN_COMMAND{{mlr sort-within-records -h}}HERE

::

POKI_RUN_COMMAND{{cat data/sort-within-records.json}}HERE

::

POKI_RUN_COMMAND{{mlr --ijson --opprint cat data/sort-within-records.json}}HERE

::

POKI_RUN_COMMAND{{mlr --json sort-within-records data/sort-within-records.json}}HERE

::

POKI_RUN_COMMAND{{mlr --ijson --opprint sort-within-records data/sort-within-records.json}}HERE

.. _reference-verbs-stats1:

stats1
Expand Down

0 comments on commit 5a453f8

Please sign in to comment.