On Sat, Nov 5, 2011 at 5:38 PM, Skip Cave <s...@caveconsulting.com> wrote:
> My next challenge is to search the log_text file for two different strings
> - a "start string" and an "end string". I need to extract any text string
> that appears between these two terminator strings. To make matters worse,
> there may be multiple start/end terminator string pairs, and I need to
> extract each and every string contained between all of the start/end
> terminator strings.
>
> Here's an example of a text file I will be parsing.
>
>    textfile
> some stuff
> some more stuff
> stuff  start string  good stuff that I want to keep end string other stuff
> more stuff
> lots of stuff, more stuff, start string more good stuff that I need end
> string stuff
> bad stuff stuff I don't care about start string even more stuff I want end
> string strange stuff
> the end
>
> <<<>>>
>
> The verb I want will take the textfile in on the right, and return all the
> text strings between "start string" and "end string" in the text file.
>
> So the result of the verb will be:
>
> good stuff that I want to keep
> more good stuff that I need
> even more stuff I want

Just wanted to check that the example textfile is "correct".
Your startstring is always 'start string', but your endstring is
sometimes 'end string' and sometimes ('end',LF,'string').  Is this
intended?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to