Hello Rob,

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.

Thanks for the "between" (by the way, it would be "zone 2-* between /X/ 4"). I forgot that "between" had this option.

But, indeed, the "between" doesn't do what I want if the searched string is on two too close lines : I'd like to keep each occurence of the string and the N lines following each occurence (my file being a traced rexx, and my string a program call, I want to keep the program calls and theirs immediate consequences).

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).

I'd be very interested to see this pipeline; I love this kind of simple questions/problems that are not so easy to solve.

Thanks
Michaël

Reply via email to