Rob van der Heij wrote:
> <[EMAIL PROTECTED]> wrote:
> > At first I thought that seemed like a job for fromtarget/totarget, but I
> > can't
> > figure out how I would reset the filters to allow second and subsequent
> > blocks
> > to be processed.
> If you need to process each block as an entity, you probably want a
> sipping pipeline.
If, on the other hand, by "reset the filters" you just mean the
FROMTARGET and TOTARGET, you can use BETWEEN by sticking identifiers on
the front of the records if they don't have them already:
(end /) ... | start: locate ... | insert "1" | all: faninany
| between "1" "2" | not chop 1 | ...
/ start: | end: locate ... | insert "2" | all:
/ end: | insert " " | all:
Regarding the sipping pipeline:
> need to make sure it consumes at least some records, or you can sip
> forever on it...
Just make sure to consume the record that ends each block. If you don't
need any data from it, you can just add a READTO after the CALLPIPE. If
you do, you'll need to use TAKE 1 on the alternate output of TOTARGET to
get it:
'callpipe (end /) *: | frtarget' from '| end: totarget' to ,
'| all: fanin |' process '| *: / end: | take 1 | all:'
You also have to worry about whether the starting and ending records can
look alike. If the starting record can look like an ending record but
can't actually *be* the ending record, you'll need another TAKE to skip
over it:
'callpipe (end /) *: | frtarget' from '| start: take 1' ,
'| all: fanin |' process '| *:' ,
'/ start: | end: totarget' to '| all:' ,
'/ end: | take 1 | all:'
¬R