reg-test refactor iterate

This commit is contained in:
John Kerl 2020-11-21 23:35:34 -05:00
parent 2a32ff38f1
commit 5e97209787
26 changed files with 2794 additions and 23 deletions

View file

@ -10,29 +10,6 @@
## ----------------------------------------------------------------
#announce NEST
#
#run_mlr cat $indir/nest-explode.dkvp
#run_mlr cat $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --values --across-fields -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --values --across-fields -f x then nest --implode --values --across-fields -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --values --across-records -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --values --across-records -f x then nest --implode --values --across-records -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --pairs --across-fields -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --pairs --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
#
#run_mlr nest --explode --pairs --across-records -f x $indir/nest-explode.dkvp
#run_mlr nest --explode --pairs --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
## ----------------------------------------------------------------
#announce FILL-DOWN

10
c/make-case Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 {case name}" 1>&2
exit 1
fi
name="$1"
shift
cat "$@" | uind -s > reg_test/case-${name}.sh

View file

@ -0,0 +1,10 @@
run_mlr --icsv --ojson cat $indir/clean-whitespace.csv
run_mlr --icsv --ojson put '$a = lstrip($a)' $indir/clean-whitespace.csv
run_mlr --icsv --ojson put '$a = rstrip($a)' $indir/clean-whitespace.csv
run_mlr --icsv --ojson put '$a = strip($a)' $indir/clean-whitespace.csv
run_mlr --icsv --ojson put '$a = collapse_whitespace($a)' $indir/clean-whitespace.csv
run_mlr --icsv --ojson put '$a = clean_whitespace($a)' $indir/clean-whitespace.csv
run_mlr --icsv --ojson clean-whitespace -k $indir/clean-whitespace.csv
run_mlr --icsv --ojson clean-whitespace -v $indir/clean-whitespace.csv
run_mlr --icsv --ojson clean-whitespace $indir/clean-whitespace.csv

View file

@ -0,0 +1,4 @@
run_mlr format-values $indir/abixy
run_mlr format-values -n $indir/abixy
run_mlr format-values -i %08llx -f %.6le -s X%sX $indir/abixy
run_mlr format-values -i %08llx -f %.6le -s X%sX -n $indir/abixy

View file

@ -0,0 +1,72 @@
# in1, in2, out all same formats
run_mlr --json join -s -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --dkvp join -s -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -s -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --json join -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --dkvp join -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
# in2 different format
run_mlr --json join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
run_mlr --dkvp join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --json join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
run_mlr --dkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --json join -s -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
run_mlr --dkvp join -s -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -s -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
run_mlr --json join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
run_mlr --dkvp join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
run_mlr --json join -s -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --dkvp join -s -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -s -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
run_mlr --json join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --dkvp join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
run_mlr --csvlite join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
# vary all three
run_mlr --ijson --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
run_mlr --idkvp --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --ijson --ojson join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
run_mlr --idkvp --ojson join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ojson join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
run_mlr --ijson --ojson join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --idkvp --ojson join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ojson join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
run_mlr --ijson --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
run_mlr --idkvp --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --ijson --odkvp join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
run_mlr --idkvp --odkvp join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --odkvp join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
run_mlr --ijson --odkvp join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --idkvp --odkvp join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --odkvp join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
run_mlr --ijson --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
run_mlr --idkvp --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
run_mlr --ijson --ocsvlite join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
run_mlr --idkvp --ocsvlite join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ocsvlite join -i dkvp -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
run_mlr --ijson --ocsvlite join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
run_mlr --idkvp --ocsvlite join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
run_mlr --icsvlite --ocsvlite join -i json -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv

View file

@ -0,0 +1,3 @@
run_mlr --prepipe cat --odkvp join -j a -f $indir/join-het.dkvp $indir/abixy-het
run_mlr --odkvp join --prepipe cat -j a -f $indir/join-het.dkvp $indir/abixy-het
run_mlr --prepipe cat --odkvp join --prepipe cat -j a -f $indir/join-het.dkvp $indir/abixy-het

90
c/reg_test/case-join.sh Normal file
View file

@ -0,0 +1,90 @@
# ----------------------------------------------------------------
announce JOIN
run_mlr --opprint join -s -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ul -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ul -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ul -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ul -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
run_mlr join -l l -r r -j j -f $indir/joina.dkvp $indir/joinb.dkvp
run_mlr join -l l -j r -f $indir/joina.dkvp $indir/joinb.dkvp
run_mlr join -r r -j l -f $indir/joina.dkvp $indir/joinb.dkvp
run_mlr --opprint join -s -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ul -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ul -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ul -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ul -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s --np --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join --np --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
run_mlr --opprint join -s -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --ul -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --ul -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --np --ul -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --np --ul -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --np --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --np --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join -s --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --opprint join --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
run_mlr --odkvp join -j a -f $indir/join-het.dkvp $indir/abixy-het
run_mlr --odkvp join -j a -f $indir/abixy-het $indir/join-het.dkvp
run_mlr --odkvp join --np --ul --ur -j a -f $indir/join-het.dkvp $indir/abixy-het
run_mlr --odkvp join --np --ul --ur -j a -f $indir/abixy-het $indir/join-het.dkvp
run_mlr --idkvp --oxtab join --lp left_ --rp right_ -j i -f $indir/abixy-het $indir/abixy-het
for sorted_flag in "-s" ""; do
for pairing_flags in "" "--np --ul" "--np --ur"; do
for i in 1 2 3 4 5 6; do
run_mlr join $sorted_flag $pairing_flags -l l -r r -j j -f $indir/het-join-left $indir/het-join-right-r$i
for j in 1 2 3 4 5 6; do
if [ "$i" -le "$j" ]; then
run_mlr join $sorted_flag $pairing_flags -l l -r r -j j -f $indir/het-join-left $indir/het-join-right-r$i$j
fi
done
done
done
done

20
c/reg_test/case-nest.sh Normal file
View file

@ -0,0 +1,20 @@
run_mlr cat $indir/nest-explode.dkvp
run_mlr cat $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --values --across-fields -f x $indir/nest-explode.dkvp
run_mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --values --across-fields -f x then nest --implode --values --across-fields -f x $indir/nest-explode.dkvp
run_mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --values --across-records -f x $indir/nest-explode.dkvp
run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --values --across-records -f x then nest --implode --values --across-records -f x $indir/nest-explode.dkvp
run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --pairs --across-fields -f x $indir/nest-explode.dkvp
run_mlr nest --explode --pairs --across-fields -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
run_mlr nest --explode --pairs --across-records -f x $indir/nest-explode.dkvp
run_mlr nest --explode --pairs --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp

View file

@ -0,0 +1,5 @@
run_mlr cat then nothing < $indir/abixy
run_mlr cat then nothing $indir/abixy
run_mlr tac then nothing $indir/abixy
run_mlr cat then nothing $indir/abixy $indir/abixy
run_mlr cat then nothing then cat $indir/abixy

View file

@ -0,0 +1 @@
run_mlr --csv remove-empty-columns $indir/remove-empty-columns.csv

View file

@ -0,0 +1,4 @@
run_mlr repeat -n 5 $indir/repeat-input.dat
run_mlr repeat -f a $indir/repeat-input.dat
run_mlr repeat -f b $indir/repeat-input.dat
run_mlr repeat -f c $indir/repeat-input.dat

View file

@ -0,0 +1,18 @@
run_mlr --pprint reshape -i X,Y,Z -o item,price $indir/reshape-wide.tbl
run_mlr --pprint reshape -i X,Z -o item,price $indir/reshape-wide.tbl
run_mlr --pprint reshape -r '[X-Z]' -o item,price $indir/reshape-wide.tbl
run_mlr --pprint reshape -r '[XZ]' -o item,price $indir/reshape-wide.tbl
run_mlr --pprint reshape -s item,price $indir/reshape-long.tbl
run_mlr --pprint reshape -i X,Y,Z -o item,price then reshape -s item,price $indir/reshape-wide.tbl
run_mlr --pprint reshape -s item,price then reshape -i X,Y,Z -o item,price $indir/reshape-long.tbl
run_mlr reshape -i X,Y,Z -o item,price $indir/reshape-wide-ragged.dkvp
run_mlr reshape -i X,Z -o item,price $indir/reshape-wide-ragged.dkvp
run_mlr reshape -r '[X-Z]' -o item,price $indir/reshape-wide-ragged.dkvp
run_mlr reshape -r '[XZ]' -o item,price $indir/reshape-wide-ragged.dkvp
run_mlr reshape -s item,price $indir/reshape-long-ragged.dkvp
run_mlr --json reshape -i x,y -o item,value $indir/small-non-nested.json

View file

@ -0,0 +1 @@
run_mlr --csv skip-trivial-records $indir/trivial-records.csv

View file

@ -0,0 +1 @@
run_mlr sort-within-records $indir/sort-within-records.dkvp

View file

@ -0,0 +1,163 @@
mlr --icsv --ojson cat ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": " xy", "b ": 2, " c": 3 }
{ "n": 7, "a": " xy", "b ": 2, " c": 3 }
{ "n": 8, "a": " xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 11, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 12, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": " ", "b ": 2, " c": 3 }
{ "n": 15, "a": " ", "b ": 2, " c": 3 }
{ "n": 16, "a": " ", "b ": 2, " c": 3 }
mlr --icsv --ojson put $a = lstrip($a) ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": "xy", "b ": 2, " c": 3 }
{ "n": 7, "a": "xy", "b ": 2, " c": 3 }
{ "n": 8, "a": "xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 11, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 12, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": "", "b ": 2, " c": 3 }
{ "n": 15, "a": "", "b ": 2, " c": 3 }
{ "n": 16, "a": "", "b ": 2, " c": 3 }
mlr --icsv --ojson put $a = rstrip($a) ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": " xy", "b ": 2, " c": 3 }
{ "n": 7, "a": " xy", "b ": 2, " c": 3 }
{ "n": 8, "a": " xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": " xy", "b ": 2, " c": 3 }
{ "n": 11, "a": " xy", "b ": 2, " c": 3 }
{ "n": 12, "a": " xy", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": "", "b ": 2, " c": 3 }
{ "n": 15, "a": "", "b ": 2, " c": 3 }
{ "n": 16, "a": "", "b ": 2, " c": 3 }
mlr --icsv --ojson put $a = strip($a) ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": "xy", "b ": 2, " c": 3 }
{ "n": 7, "a": "xy", "b ": 2, " c": 3 }
{ "n": 8, "a": "xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": "xy", "b ": 2, " c": 3 }
{ "n": 11, "a": "xy", "b ": 2, " c": 3 }
{ "n": 12, "a": "xy", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": "", "b ": 2, " c": 3 }
{ "n": 15, "a": "", "b ": 2, " c": 3 }
{ "n": 16, "a": "", "b ": 2, " c": 3 }
mlr --icsv --ojson put $a = collapse_whitespace($a) ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy ", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": " xy", "b ": 2, " c": 3 }
{ "n": 7, "a": " xy", "b ": 2, " c": 3 }
{ "n": 8, "a": " xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 11, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 12, "a": " xy ", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": " ", "b ": 2, " c": 3 }
{ "n": 15, "a": " ", "b ": 2, " c": 3 }
{ "n": 16, "a": " ", "b ": 2, " c": 3 }
mlr --icsv --ojson put $a = clean_whitespace($a) ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": "xy", "b ": 2, " c": 3 }
{ "n": 7, "a": "xy", "b ": 2, " c": 3 }
{ "n": 8, "a": "xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": "xy", "b ": 2, " c": 3 }
{ "n": 11, "a": "xy", "b ": 2, " c": 3 }
{ "n": 12, "a": "xy", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": "", "b ": 2, " c": 3 }
{ "n": 15, "a": "", "b ": 2, " c": 3 }
{ "n": 16, "a": "", "b ": 2, " c": 3 }
mlr --icsv --ojson clean-whitespace -k ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b": 2, "c": 3 }
{ "n": 2, "a": "xy ", "b": 2, "c": 3 }
{ "n": 3, "a": "xy ", "b": 2, "c": 3 }
{ "n": 4, "a": "xy ", "b": 2, "c": 3 }
{ "n": 5, "a": "xy", "b": 2, "c": 3 }
{ "n": 6, "a": " xy", "b": 2, "c": 3 }
{ "n": 7, "a": " xy", "b": 2, "c": 3 }
{ "n": 8, "a": " xy", "b": 2, "c": 3 }
{ "n": 9, "a": "xy", "b": 2, "c": 3 }
{ "n": 10, "a": " xy ", "b": 2, "c": 3 }
{ "n": 11, "a": " xy ", "b": 2, "c": 3 }
{ "n": 12, "a": " xy ", "b": 2, "c": 3 }
{ "n": 13, "a": "", "b": 2, "c": 3 }
{ "n": 14, "a": " ", "b": 2, "c": 3 }
{ "n": 15, "a": " ", "b": 2, "c": 3 }
{ "n": 16, "a": " ", "b": 2, "c": 3 }
mlr --icsv --ojson clean-whitespace -v ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b ": 2, " c": 3 }
{ "n": 2, "a": "xy", "b ": 2, " c": 3 }
{ "n": 3, "a": "xy", "b ": 2, " c": 3 }
{ "n": 4, "a": "xy", "b ": 2, " c": 3 }
{ "n": 5, "a": "xy", "b ": 2, " c": 3 }
{ "n": 6, "a": "xy", "b ": 2, " c": 3 }
{ "n": 7, "a": "xy", "b ": 2, " c": 3 }
{ "n": 8, "a": "xy", "b ": 2, " c": 3 }
{ "n": 9, "a": "xy", "b ": 2, " c": 3 }
{ "n": 10, "a": "xy", "b ": 2, " c": 3 }
{ "n": 11, "a": "xy", "b ": 2, " c": 3 }
{ "n": 12, "a": "xy", "b ": 2, " c": 3 }
{ "n": 13, "a": "", "b ": 2, " c": 3 }
{ "n": 14, "a": "", "b ": 2, " c": 3 }
{ "n": 15, "a": "", "b ": 2, " c": 3 }
{ "n": 16, "a": "", "b ": 2, " c": 3 }
mlr --icsv --ojson clean-whitespace ./reg_test/input/clean-whitespace.csv
{ "n": 1, "a": "xy", "b": 2, "c": 3 }
{ "n": 2, "a": "xy", "b": 2, "c": 3 }
{ "n": 3, "a": "xy", "b": 2, "c": 3 }
{ "n": 4, "a": "xy", "b": 2, "c": 3 }
{ "n": 5, "a": "xy", "b": 2, "c": 3 }
{ "n": 6, "a": "xy", "b": 2, "c": 3 }
{ "n": 7, "a": "xy", "b": 2, "c": 3 }
{ "n": 8, "a": "xy", "b": 2, "c": 3 }
{ "n": 9, "a": "xy", "b": 2, "c": 3 }
{ "n": 10, "a": "xy", "b": 2, "c": 3 }
{ "n": 11, "a": "xy", "b": 2, "c": 3 }
{ "n": 12, "a": "xy", "b": 2, "c": 3 }
{ "n": 13, "a": "", "b": 2, "c": 3 }
{ "n": 14, "a": "", "b": 2, "c": 3 }
{ "n": 15, "a": "", "b": 2, "c": 3 }
{ "n": 16, "a": "", "b": 2, "c": 3 }

View file

@ -0,0 +1,49 @@
mlr format-values ./reg_test/input/abixy
a=pan,b=pan,i=1,x=0.346790,y=0.726803
a=eks,b=pan,i=2,x=0.758680,y=0.522151
a=wye,b=wye,i=3,x=0.204603,y=0.338319
a=eks,b=wye,i=4,x=0.381399,y=0.134189
a=wye,b=pan,i=5,x=0.573289,y=0.863624
a=zee,b=pan,i=6,x=0.527126,y=0.493221
a=eks,b=zee,i=7,x=0.611784,y=0.187885
a=zee,b=wye,i=8,x=0.598554,y=0.976181
a=hat,b=wye,i=9,x=0.031442,y=0.749551
a=pan,b=wye,i=10,x=0.502626,y=0.952618
mlr format-values -n ./reg_test/input/abixy
a=pan,b=pan,i=1.000000,x=0.346790,y=0.726803
a=eks,b=pan,i=2.000000,x=0.758680,y=0.522151
a=wye,b=wye,i=3.000000,x=0.204603,y=0.338319
a=eks,b=wye,i=4.000000,x=0.381399,y=0.134189
a=wye,b=pan,i=5.000000,x=0.573289,y=0.863624
a=zee,b=pan,i=6.000000,x=0.527126,y=0.493221
a=eks,b=zee,i=7.000000,x=0.611784,y=0.187885
a=zee,b=wye,i=8.000000,x=0.598554,y=0.976181
a=hat,b=wye,i=9.000000,x=0.031442,y=0.749551
a=pan,b=wye,i=10.000000,x=0.502626,y=0.952618
mlr format-values -i %08llx -f %.6le -s X%sX ./reg_test/input/abixy
a=XpanX,b=XpanX,i=00000001,x=3.467901e-01,y=7.268029e-01
a=XeksX,b=XpanX,i=00000002,x=7.586800e-01,y=5.221511e-01
a=XwyeX,b=XwyeX,i=00000003,x=2.046033e-01,y=3.383185e-01
a=XeksX,b=XwyeX,i=00000004,x=3.813994e-01,y=1.341887e-01
a=XwyeX,b=XpanX,i=00000005,x=5.732889e-01,y=8.636245e-01
a=XzeeX,b=XpanX,i=00000006,x=5.271262e-01,y=4.932213e-01
a=XeksX,b=XzeeX,i=00000007,x=6.117841e-01,y=1.878849e-01
a=XzeeX,b=XwyeX,i=00000008,x=5.985540e-01,y=9.761814e-01
a=XhatX,b=XwyeX,i=00000009,x=3.144188e-02,y=7.495508e-01
a=XpanX,b=XwyeX,i=0000000a,x=5.026260e-01,y=9.526184e-01
mlr format-values -i %08llx -f %.6le -s X%sX -n ./reg_test/input/abixy
a=XpanX,b=XpanX,i=1.000000e+00,x=3.467901e-01,y=7.268029e-01
a=XeksX,b=XpanX,i=2.000000e+00,x=7.586800e-01,y=5.221511e-01
a=XwyeX,b=XwyeX,i=3.000000e+00,x=2.046033e-01,y=3.383185e-01
a=XeksX,b=XwyeX,i=4.000000e+00,x=3.813994e-01,y=1.341887e-01
a=XwyeX,b=XpanX,i=5.000000e+00,x=5.732889e-01,y=8.636245e-01
a=XzeeX,b=XpanX,i=6.000000e+00,x=5.271262e-01,y=4.932213e-01
a=XeksX,b=XzeeX,i=7.000000e+00,x=6.117841e-01,y=1.878849e-01
a=XzeeX,b=XwyeX,i=8.000000e+00,x=5.985540e-01,y=9.761814e-01
a=XhatX,b=XwyeX,i=9.000000e+00,x=3.144188e-02,y=7.495508e-01
a=XpanX,b=XwyeX,i=1.000000e+01,x=5.026260e-01,y=9.526184e-01

View file

@ -0,0 +1,324 @@
mlr --json join -s -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -s -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -s -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -s -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -s -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -s -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -s -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -s -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -s -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -s -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -s -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -s -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --json join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --dkvp join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --csvlite join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --ijson --ojson join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --idkvp --ojson join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.dkvp
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --icsvlite --ojson join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --ijson --ojson join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --idkvp --ojson join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --icsvlite --ojson join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.csv
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --ijson --ojson join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --idkvp --ojson join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.dkvp
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --icsvlite --ojson join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.csv
{ "x": 1, "a": 2, "b": 20 }
{ "x": 2, "a": 3, "b": 30 }
{ "x": 3, "a": 4, "b": 40 }
{ "x": 4, "a": 5, "b": 50 }
mlr --ijson --odkvp join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.json
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --idkvp --odkvp join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --icsvlite --odkvp join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --ijson --odkvp join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.json
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --idkvp --odkvp join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --icsvlite --odkvp join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.csv
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --ijson --odkvp join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --idkvp --odkvp join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.dkvp
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --icsvlite --odkvp join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.csv
x=1,a=2,b=20
x=2,a=3,b=30
x=3,a=4,b=40
x=4,a=5,b=50
mlr --ijson --ocsvlite join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.json
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --idkvp --ocsvlite join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.dkvp
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --icsvlite --ocsvlite join -i csvlite -j x -f ./reg_test/input/multi-format-join-a.csv ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --ijson --ocsvlite join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.json
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --idkvp --ocsvlite join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.dkvp
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --icsvlite --ocsvlite join -i dkvp -j x -f ./reg_test/input/multi-format-join-a.dkvp ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --ijson --ocsvlite join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.json
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --idkvp --ocsvlite join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.dkvp
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50
mlr --icsvlite --ocsvlite join -i json -j x -f ./reg_test/input/multi-format-join-a.json ./reg_test/input/multi-format-join-b.csv
x,a,b
1,2,20
2,3,30
3,4,40
4,5,50

View file

@ -0,0 +1,31 @@
mlr --prepipe cat --odkvp join -j a -f ./reg_test/input/join-het.dkvp ./reg_test/input/abixy-het
a=pan,n=234,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,n=123,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,n=123,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,n=345,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729
a=zee,n=456,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,n=123,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,n=456,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006
a=pan,n=234,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
mlr --odkvp join --prepipe cat -j a -f ./reg_test/input/join-het.dkvp ./reg_test/input/abixy-het
a=pan,n=234,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,n=123,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,n=123,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,n=345,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729
a=zee,n=456,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,n=123,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,n=456,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006
a=pan,n=234,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864
mlr --prepipe cat --odkvp join --prepipe cat -j a -f ./reg_test/input/join-het.dkvp ./reg_test/input/abixy-het
a=pan,n=234,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,n=123,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=eks,n=123,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,n=345,b=pan,i=5,xxx=0.5732889198020006,y=0.8636244699032729
a=zee,n=456,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,n=123,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,n=456,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006
a=pan,n=234,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,97 @@
mlr cat ./reg_test/input/nest-explode.dkvp
x=a:1;b:2;c:3,y=d:40
x=,y=d:50
u=100,y=d:60
x=a:4;b:5,y=d:70
mlr cat ./reg_test/input/nest-explode-vary-fs-ps.dkvp
x=a=1|b=2|c=3,y=d=40
x=,y=d=50
u=100,y=d=60
x=a=4|b=5,y=d=70
mlr nest --explode --values --across-fields -f x ./reg_test/input/nest-explode.dkvp
x_1=a:1,x_2=b:2,x_3=c:3,y=d:40
x_1=,y=d:50
u=100,y=d:60
x_1=a:4,x_2=b:5,y=d:70
mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
x_1=a=1,x_2=b=2,x_3=c=3,y=d=40
x_1=,y=d=50
u=100,y=d=60
x_1=a=4,x_2=b=5,y=d=70
mlr nest --explode --values --across-fields -f x then nest --implode --values --across-fields -f x ./reg_test/input/nest-explode.dkvp
x=a:1;b:2;c:3,y=d:40
x=,y=d:50
u=100,y=d:60
x=a:4;b:5,y=d:70
mlr nest --explode --values --across-fields -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-fields -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
x=a=1|b=2|c=3,y=d=40
x=,y=d=50
u=100,y=d=60
x=a=4|b=5,y=d=70
mlr nest --explode --values --across-records -f x ./reg_test/input/nest-explode.dkvp
x=a:1,y=d:40
x=b:2,y=d:40
x=c:3,y=d:40
x=,y=d:50
u=100,y=d:60
x=a:4,y=d:70
x=b:5,y=d:70
mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
x=a=1,y=d=40
x=b=2,y=d=40
x=c=3,y=d=40
x=,y=d=50
u=100,y=d=60
x=a=4,y=d=70
x=b=5,y=d=70
mlr nest --explode --values --across-records -f x then nest --implode --values --across-records -f x ./reg_test/input/nest-explode.dkvp
u=100,y=d:60
x=a:1;b:2;c:3,y=d:40
x=,y=d:50
x=a:4;b:5,y=d:70
mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-records -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
u=100,y=d=60
x=a=1|b=2|c=3,y=d=40
x=,y=d=50
x=a=4|b=5,y=d=70
mlr nest --explode --pairs --across-fields -f x ./reg_test/input/nest-explode.dkvp
a=1,b=2,c=3,y=d:40
y=d:50
u=100,y=d:60
a=4,b=5,y=d:70
mlr nest --explode --pairs --across-fields -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
a=1,b=2,c=3,y=d=40
y=d=50
u=100,y=d=60
a=4,b=5,y=d=70
mlr nest --explode --pairs --across-records -f x ./reg_test/input/nest-explode.dkvp
a=1,y=d:40
b=2,y=d:40
c=3,y=d:40
y=d:50
u=100,y=d:60
a=4,y=d:70
b=5,y=d:70
mlr nest --explode --pairs --across-records -f x --nested-fs pipe --nested-ps = ./reg_test/input/nest-explode-vary-fs-ps.dkvp
a=1,y=d=40
b=2,y=d=40
c=3,y=d=40
y=d=50
u=100,y=d=60
a=4,y=d=70
b=5,y=d=70

View file

@ -0,0 +1,11 @@
mlr cat then nothing
mlr cat then nothing ./reg_test/input/abixy
mlr tac then nothing ./reg_test/input/abixy
mlr cat then nothing ./reg_test/input/abixy ./reg_test/input/abixy
mlr cat then nothing then cat ./reg_test/input/abixy

View file

@ -0,0 +1,7 @@
mlr --csv remove-empty-columns ./reg_test/input/remove-empty-columns.csv
a,c,e
1,3,5
2,4,5
3,5,7

View file

@ -0,0 +1,77 @@
mlr repeat -n 5 ./reg_test/input/repeat-input.dat
a=1,b=2,c=3
a=1,b=2,c=3
a=1,b=2,c=3
a=1,b=2,c=3
a=1,b=2,c=3
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
mlr repeat -f a ./reg_test/input/repeat-input.dat
a=1,b=2,c=3
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
mlr repeat -f b ./reg_test/input/repeat-input.dat
a=1,b=2,c=3
a=1,b=2,c=3
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
mlr repeat -f c ./reg_test/input/repeat-input.dat
a=1,b=2,c=3
a=1,b=2,c=3
a=1,b=2,c=3
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=3,b=4,c=5
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=6,b=,c=7
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9
a=8,x=,c=9

View file

@ -0,0 +1,165 @@
mlr --pprint reshape -i X,Y,Z -o item,price ./reg_test/input/reshape-wide.tbl
time item price
2009-01-01 X 0.65473572
2009-01-01 Y 2.4520609
2009-01-01 Z -1.46570942
2009-01-02 X -0.89248112
2009-01-02 Y 0.2154713
2009-01-02 Z -2.05357735
2009-01-03 X 0.98012375
2009-01-03 Y 1.3179287
2009-01-03 Z 4.64248357
2009-01-04 X 0.35397376
2009-01-04 Y 3.3765645
2009-01-04 Z -0.25237774
2009-01-05 X 2.19357813
2009-01-05 Y 1.3477511
2009-01-05 Z 0.09719105
mlr --pprint reshape -i X,Z -o item,price ./reg_test/input/reshape-wide.tbl
time Y item price
2009-01-01 2.4520609 X 0.65473572
2009-01-01 2.4520609 Z -1.46570942
2009-01-02 0.2154713 X -0.89248112
2009-01-02 0.2154713 Z -2.05357735
2009-01-03 1.3179287 X 0.98012375
2009-01-03 1.3179287 Z 4.64248357
2009-01-04 3.3765645 X 0.35397376
2009-01-04 3.3765645 Z -0.25237774
2009-01-05 1.3477511 X 2.19357813
2009-01-05 1.3477511 Z 0.09719105
mlr --pprint reshape -r [X-Z] -o item,price ./reg_test/input/reshape-wide.tbl
time item price
2009-01-01 X 0.65473572
2009-01-01 Y 2.4520609
2009-01-01 Z -1.46570942
2009-01-02 X -0.89248112
2009-01-02 Y 0.2154713
2009-01-02 Z -2.05357735
2009-01-03 X 0.98012375
2009-01-03 Y 1.3179287
2009-01-03 Z 4.64248357
2009-01-04 X 0.35397376
2009-01-04 Y 3.3765645
2009-01-04 Z -0.25237774
2009-01-05 X 2.19357813
2009-01-05 Y 1.3477511
2009-01-05 Z 0.09719105
mlr --pprint reshape -r [XZ] -o item,price ./reg_test/input/reshape-wide.tbl
time Y item price
2009-01-01 2.4520609 X 0.65473572
2009-01-01 2.4520609 Z -1.46570942
2009-01-02 0.2154713 X -0.89248112
2009-01-02 0.2154713 Z -2.05357735
2009-01-03 1.3179287 X 0.98012375
2009-01-03 1.3179287 Z 4.64248357
2009-01-04 3.3765645 X 0.35397376
2009-01-04 3.3765645 Z -0.25237774
2009-01-05 1.3477511 X 2.19357813
2009-01-05 1.3477511 Z 0.09719105
mlr --pprint reshape -s item,price ./reg_test/input/reshape-long.tbl
time X Y Z
2009-01-01 0.65473572 2.4520609 -1.46570942
2009-01-02 -0.89248112 0.2154713 -2.05357735
2009-01-03 0.98012375 1.3179287 4.64248357
2009-01-04 0.35397376 3.3765645 -0.25237774
2009-01-05 2.19357813 1.3477511 0.09719105
mlr --pprint reshape -i X,Y,Z -o item,price then reshape -s item,price ./reg_test/input/reshape-wide.tbl
time X Y Z
2009-01-01 0.65473572 2.4520609 -1.46570942
2009-01-02 -0.89248112 0.2154713 -2.05357735
2009-01-03 0.98012375 1.3179287 4.64248357
2009-01-04 0.35397376 3.3765645 -0.25237774
2009-01-05 2.19357813 1.3477511 0.09719105
mlr --pprint reshape -s item,price then reshape -i X,Y,Z -o item,price ./reg_test/input/reshape-long.tbl
time item price
2009-01-01 X 0.65473572
2009-01-01 Y 2.4520609
2009-01-01 Z -1.46570942
2009-01-02 X -0.89248112
2009-01-02 Y 0.2154713
2009-01-02 Z -2.05357735
2009-01-03 X 0.98012375
2009-01-03 Y 1.3179287
2009-01-03 Z 4.64248357
2009-01-04 X 0.35397376
2009-01-04 Y 3.3765645
2009-01-04 Z -0.25237774
2009-01-05 X 2.19357813
2009-01-05 Y 1.3477511
2009-01-05 Z 0.09719105
mlr reshape -i X,Y,Z -o item,price ./reg_test/input/reshape-wide-ragged.dkvp
time=2009-01-01,item=X,price=0.65473572
time=2009-01-01,item=Y,price=2.4520609
time=2009-01-01,item=Z,price=-1.46570942
time=2009-01-02,item=X,price=-0.89248112
time=2009-01-02,item=Y,price=0.2154713
time=2009-01-03,item=X,price=0.98012375
time=2009-01-04
time=2009-01-05,U=1.3477511,V=0.09719105,item=X,price=2.19357813
mlr reshape -i X,Z -o item,price ./reg_test/input/reshape-wide-ragged.dkvp
time=2009-01-01,Y=2.4520609,item=X,price=0.65473572
time=2009-01-01,Y=2.4520609,item=Z,price=-1.46570942
time=2009-01-02,Y=0.2154713,item=X,price=-0.89248112
time=2009-01-03,item=X,price=0.98012375
time=2009-01-04
time=2009-01-05,U=1.3477511,V=0.09719105,item=X,price=2.19357813
mlr reshape -r [X-Z] -o item,price ./reg_test/input/reshape-wide-ragged.dkvp
time=2009-01-01,item=X,price=0.65473572
time=2009-01-01,item=Y,price=2.4520609
time=2009-01-01,item=Z,price=-1.46570942
time=2009-01-02,item=X,price=-0.89248112
time=2009-01-02,item=Y,price=0.2154713
time=2009-01-03,item=X,price=0.98012375
time=2009-01-04
time=2009-01-05,U=1.3477511,V=0.09719105,item=X,price=2.19357813
mlr reshape -r [XZ] -o item,price ./reg_test/input/reshape-wide-ragged.dkvp
time=2009-01-01,Y=2.4520609,item=X,price=0.65473572
time=2009-01-01,Y=2.4520609,item=Z,price=-1.46570942
time=2009-01-02,Y=0.2154713,item=X,price=-0.89248112
time=2009-01-03,item=X,price=0.98012375
time=2009-01-04
time=2009-01-05,U=1.3477511,V=0.09719105,item=X,price=2.19357813
mlr reshape -s item,price ./reg_test/input/reshape-long-ragged.dkvp
time=2009-01-01,item=X,value=0.65473572
time=2009-01-01,item=Y,value=2.4520609
time=2009-01-01,item=Z,value=-1.46570942
time=2009-01-02,item=X,value=-0.89248112
time=2009-01-02,item=Y,value=0.2154713
time=2009-01-03,item=X,value=0.98012375
time=2009-01-04
time=2009-01-05,U=1.3477511,V=0.09719105,item=X,value=2.19357813
mlr --json reshape -i x,y -o item,value ./reg_test/input/small-non-nested.json
{ "a": "pan", "b": "pan", "i": 1, "item": "x", "value": 0.3467901443380824 }
{ "a": "pan", "b": "pan", "i": 1, "item": "y", "value": 0.7268028627434533 }
{ "a": "eks", "b": "pan", "i": 2, "item": "x", "value": 0.7586799647899636 }
{ "a": "eks", "b": "pan", "i": 2, "item": "y", "value": 0.5221511083334797 }
{ "a": "wye", "b": "wye", "i": 3, "item": "x", "value": 0.20460330576630303 }
{ "a": "wye", "b": "wye", "i": 3, "item": "y", "value": 0.33831852551664776 }
{ "a": "eks", "b": "wye", "i": 4, "item": "x", "value": 0.38139939387114097 }
{ "a": "eks", "b": "wye", "i": 4, "item": "y", "value": 0.13418874328430463 }
{ "a": "wye", "b": "pan", "i": 5, "item": "x", "value": 0.5732889198020006 }
{ "a": "wye", "b": "pan", "i": 5, "item": "y", "value": 0.8636244699032729 }
{ "a": "zee", "b": "pan", "i": 6, "item": "x", "value": 0.5271261600918548 }
{ "a": "zee", "b": "pan", "i": 6, "item": "y", "value": 0.49322128674835697 }
{ "a": "eks", "b": "zee", "i": 7, "item": "x", "value": 0.6117840605678454 }
{ "a": "eks", "b": "zee", "i": 7, "item": "y", "value": 0.1878849191181694 }
{ "a": "zee", "b": "wye", "i": 8, "item": "x", "value": 0.5985540091064224 }
{ "a": "zee", "b": "wye", "i": 8, "item": "y", "value": 0.976181385699006 }
{ "a": "hat", "b": "wye", "i": 9, "item": "x", "value": 0.03144187646093577 }
{ "a": "hat", "b": "wye", "i": 9, "item": "y", "value": 0.7495507603507059 }
{ "a": "pan", "b": "wye", "i": 10, "item": "x", "value": 0.5026260055412137 }
{ "a": "pan", "b": "wye", "i": 10, "item": "y", "value": 0.9526183602969864 }

View file

@ -0,0 +1,7 @@
mlr --csv skip-trivial-records ./reg_test/input/trivial-records.csv
a,b,c
1,2,3
4,,6
,8,9

View file

@ -0,0 +1,13 @@
mlr sort-within-records ./reg_test/input/sort-within-records.dkvp
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697
a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694
a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006
a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059
a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864