From 8ecd9ddaa3da562a0390716b65909da52bf2e382 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Wed, 21 Oct 2015 18:26:13 -0400 Subject: [PATCH] heterogeneous-sort feature --- doc/content-for-reference.html | 4 ++-- doc/data/sort-het.dkvp | 11 +++++++---- doc/record-heterogeneity.html | 22 ++++++++++++++-------- doc/reference.html | 6 +++--- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/doc/content-for-reference.html b/doc/content-for-reference.html index fc53661d2..3c7b973db 100644 --- a/doc/content-for-reference.html +++ b/doc/content-for-reference.html @@ -602,8 +602,8 @@ POKI_RUN_COMMAND{{head -n 20 data/multicountdown.dat | mlr --opprint sort -f col

Any records not having all specified sort keys will appear at the end of the output, in the order they were encountered, regardless of sort order: -POKI_RUN_COMMAND{{mlr sort -n x data/sort-het.dkvp}}HERE -POKI_RUN_COMMAND{{mlr sort -nr x data/sort-het.dkvp}}HERE +POKI_RUN_COMMAND{{mlr sort -n x data/sort-missing.dkvp}}HERE +POKI_RUN_COMMAND{{mlr sort -nr x data/sort-missing.dkvp}}HERE

stats1

diff --git a/doc/data/sort-het.dkvp b/doc/data/sort-het.dkvp index 0896145f4..e4bc52e47 100644 --- a/doc/data/sort-het.dkvp +++ b/doc/data/sort-het.dkvp @@ -1,4 +1,7 @@ -x=2 -a=3 -x=4 -x=1 +count=500,color=green +count=600 +status=ok,count=250,hours=0.22 +status=ok,count=200,hours=3.4 +count=300,color=blue +count=100,color=green +count=450 diff --git a/doc/record-heterogeneity.html b/doc/record-heterogeneity.html index 86d5bb113..a3d490d93 100644 --- a/doc/record-heterogeneity.html +++ b/doc/record-heterogeneity.html @@ -300,10 +300,13 @@ vary, and moreover the sorted-on field name(s) don’t need to be in the sam
 $ cat data/sort-het.dkvp
-x=2
-a=3
-x=4
-x=1
+count=500,color=green
+count=600
+status=ok,count=250,hours=0.22
+status=ok,count=200,hours=3.4
+count=300,color=blue
+count=100,color=green
+count=450
 

@@ -312,10 +315,13 @@ x=1

 $ mlr sort -n count data/sort-het.dkvp
-x=2
-a=3
-x=4
-x=1
+count=100,color=green
+status=ok,count=200,hours=3.4
+status=ok,count=250,hours=0.22
+count=300,color=blue
+count=450
+count=500,color=green
+count=600
 

diff --git a/doc/reference.html b/doc/reference.html index f862f1f48..5f0dcf4ac 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -1895,12 +1895,12 @@ upsec color count

Any records not having all specified sort keys will appear at the end of the output, in the order they -were encountered, regardless of sort order. +were encountered, regardless of sort order:

-$ mlr sort -n  x data/sort-het.dkvp
+$ mlr sort -n  x data/sort-missing.dkvp
 x=1
 x=2
 x=4
@@ -1911,7 +1911,7 @@ a=3
 

-$ mlr sort -nr x data/sort-het.dkvp
+$ mlr sort -nr x data/sort-missing.dkvp
 x=4
 x=2
 x=1