On 4/21/2015 2:54 PM, I wrote:
> right way to get the first few of a run of matching lines and leave the
> rest in the pipeline:
>
> 'callpipe *: | totarget pick w4 ==' this '| take 10 |' etc.
Oops, that should be either *not* equal or "nonmatching."
Swapping the order of TAKE and TOTARGET seems to solve my immediate problem:
'callpipe *: | take 10 | totarget pick w4 ¬==' this '|' etc.
But it leaves me with an uneasy feeling about whether something
downstream would bring the problem back.
Let me back up a step here. What I really want is lines matching the
one that's currently on the input. I'm reading it with PEEKTO to build
my PICK argument:
'peekto line'
Parse Var line . . . this .
'callpipe *: | take 10 | totarget pick w4 ¬== "'this'" |' etc.
But have I overlooked a straightforward way to match it right in the
pipeline? I could make a complicated tangle of FANOUT|LOOKUP|GATE, but
that's not much of an improvement. In fact, when I tried it, I wound up
losing the first record of the *next* matching run and haven't figured
out where:
'callpipe (end /) stop: fanin' ,
'| done: gate' ,
'/ *:' ,
'| take' num ,
'| dup: not fanout' ,
'| match: lookup' col 'detail' ,
'| done:' ,
'| *:' ,
'/ dup:' ,
'| take 1' ,
'| match:' ,
'| stop:' ,
Who's releasing the record that closes the GATE?
¬R