In that case the following is one approach

textfile=: 0 : 0
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
string stuff
bad stuff stuff I don't care about start string even more stuff I want end
end string strange stuff
the end
)


getTagContents=: dyad define
  'starttag endtag'=. x
  (endtag&taketo)&.>@(starttag&E. <@((#starttag)&}.);.1 ]) y
)

   > ('start string';'end string') getTagContents textfile
  good stuff that I want to keep
 more good stuff that I need
 even more stuff I want end



On Sat, Nov 5, 2011 at 6:15 PM, Skip Cave <[email protected]> wrote:
> Oops. All start string terminators in the file will always be the same, and
> all end string terminators will always be the same. That LF in the file was
> a typo.
>
> Skip
>
> 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
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to