mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-20 18:10:07 +00:00
UT unset of indirect srec and indirect oosvar
This commit is contained in:
parent
d519af904f
commit
9a9903e98c
2 changed files with 75 additions and 0 deletions
|
|
@ -14567,6 +14567,67 @@ a=wye,variable.name=0.777892
|
|||
a=zee,variable.name=1.125680
|
||||
a=hat,variable.name=0.031442
|
||||
|
||||
mlr put for (k,v in $*) { if (k == "i") {unset $[k]}} ./reg_test/input/abixy
|
||||
a=pan,b=pan,x=0.3467901443380824,y=0.7268028627434533
|
||||
a=eks,b=pan,x=0.7586799647899636,y=0.5221511083334797
|
||||
a=wye,b=wye,x=0.20460330576630303,y=0.33831852551664776
|
||||
a=eks,b=wye,x=0.38139939387114097,y=0.13418874328430463
|
||||
a=wye,b=pan,x=0.5732889198020006,y=0.8636244699032729
|
||||
a=zee,b=pan,x=0.5271261600918548,y=0.49322128674835697
|
||||
a=eks,b=zee,x=0.6117840605678454,y=0.1878849191181694
|
||||
a=zee,b=wye,x=0.5985540091064224,y=0.976181385699006
|
||||
a=hat,b=wye,x=0.03144187646093577,y=0.7495507603507059
|
||||
a=pan,b=wye,x=0.5026260055412137,y=0.9526183602969864
|
||||
|
||||
mlr --opprint --from ./reg_test/input/abixy put -q
|
||||
@output[NR] = $*;
|
||||
end {
|
||||
for ((nr, k), v in @output) {
|
||||
if (nr == 4 || k == "i") {
|
||||
unset @output[nr][k]
|
||||
}
|
||||
}
|
||||
emitp @output, "NR", "k"
|
||||
}
|
||||
|
||||
NR k output
|
||||
1 a pan
|
||||
1 b pan
|
||||
1 x 0.3467901443380824
|
||||
1 y 0.7268028627434533
|
||||
2 a eks
|
||||
2 b pan
|
||||
2 x 0.7586799647899636
|
||||
2 y 0.5221511083334797
|
||||
3 a wye
|
||||
3 b wye
|
||||
3 x 0.20460330576630303
|
||||
3 y 0.33831852551664776
|
||||
5 a wye
|
||||
5 b pan
|
||||
5 x 0.5732889198020006
|
||||
5 y 0.8636244699032729
|
||||
6 a zee
|
||||
6 b pan
|
||||
6 x 0.5271261600918548
|
||||
6 y 0.49322128674835697
|
||||
7 a eks
|
||||
7 b zee
|
||||
7 x 0.6117840605678454
|
||||
7 y 0.1878849191181694
|
||||
8 a zee
|
||||
8 b wye
|
||||
8 x 0.5985540091064224
|
||||
8 y 0.976181385699006
|
||||
9 a hat
|
||||
9 b wye
|
||||
9 x 0.03144187646093577
|
||||
9 y 0.7495507603507059
|
||||
10 a pan
|
||||
10 b wye
|
||||
10 x 0.5026260055412137
|
||||
10 y 0.9526183602969864
|
||||
|
||||
|
||||
================================================================
|
||||
DSL PATTERN-ACTION BLOCKS
|
||||
|
|
|
|||
|
|
@ -1532,6 +1532,20 @@ run_mlr put 'unset $*; $aaa = 999' $indir/unset4.dkvp
|
|||
run_mlr put -q '@{variable.name} += $x; end{emit @{variable.name}}' $indir/abixy
|
||||
run_mlr put -q '@{variable.name}[$a] += $x; end{emit @{variable.name},"a"}' $indir/abixy
|
||||
|
||||
run_mlr put 'for (k,v in $*) { if (k == "i") {unset $[k]}}' $indir/abixy
|
||||
|
||||
run_mlr --opprint --from $indir/abixy put -q '
|
||||
@output[NR] = $*;
|
||||
end {
|
||||
for ((nr, k), v in @output) {
|
||||
if (nr == 4 || k == "i") {
|
||||
unset @output[nr][k]
|
||||
}
|
||||
}
|
||||
emitp @output, "NR", "k"
|
||||
}
|
||||
'
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
announce DSL PATTERN-ACTION BLOCKS
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue