On Thu, Sep 1, 2011 at 10:27 AM, DUGALEIX Michaël
<michael.dugal...@cegedim.fr> wrote:

> Unfortunately, my CMS-pipelines version is too old to know these options of
> pick :-(

There's always the hard way ;-)    zone 2-* between /theString/ 4

Don't know what you want to do with the cases in the gray area, like
the string occur within the 4 records after a previous one... Or when
you have multiple strings to search for. Maybe you know your data well
enough to decide.

One of my text search pipelines needed to select the lines (n-2) to
(n+2) when the match is on line (n). With two hits at (n) and (m)
close enough together, I wanted (n-2) to (m+2), etc...  Done in a
single spec stage with "if" to select the line numbers (they go to
diskrand to pull those lines).

> Is there a way to tell "spec" not to write these null lines in the first
> place ?

The "spec" stage will produce a null record when you suppress all
content, so "locate" should be enough. The "if" isn't really meant to
select records. It normally produces a record for each input record.
Maybe you can use "printonly eof" and force the actual records with a
"write" in the "spec"  But ugly is an understatement...

| Sir Rob the Plumber

Reply via email to