Re: extract a text, from a text file, that is contained between two strings



Giordano wrote:
Hi to everybody...

Can you tell me your best way to
extract a text, from a text file, that is contained between two
strings

example: we have a file which contains these words
<<
Ei fu. Siccome immobile,
dato il mortal sospiro,
stette la spoglia immemore
orba di tanto spiro,
...

I want extract that word contained between the 2 words "la" and
"immemore"
(this word will be "spoglia" at 3rd row, but I mean that more words
could be present & contained in the same 'range')

Thanks to everybody,
I will be happy to read your opinions.
:)
Bye


If your markers (la and immemore) are constant, read the file into a String, use indexOf(String) to find each and then substring the range in between.

--
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/
.



Relevant Pages