New To Java - Text Processing

hi,

my String variable contains the fallowing data.

[

URL = "http://www.apple.com/"

Title = "Apple"

Snippet = "Official site ofApple Computer, Inc."

Directory Category = {SE="", FVN=""}

Directory Title = ""

Summary = ""

Cached Size = "33k"

Related information present = true

Host Name = "www.apple.com"

],

[

URL = "http://www.apple.com/quicktime/"

Title = "Apple - QuickTime"

Snippet = "Apple's free media player supporting innumerable audio and video formats. The pro

version includes an abundance of media authoring capabilities."

Directory Category = {SE="", FVN=""}

Directory Title = ""

Summary = ""

Cached Size = "7k"

Related information present = true

Host Name = "www.apple.com"

],

[

URL=""

title=""

snippet=""

]... like that

now i need to extract and store only URL,corresponding Title and snippet parts only.How could i do that?Please give me reply.

thanking you inadvance.

[1121 byte] By [anchipkaa] at [2007-11-26 23:18:32]
# 1
Answered here: http://forum.java.sun.com/thread.jspa?threadID=5152034
prometheuzza at 2007-7-10 14:20:36 > top of Java-index,Java Essentials,New To Java...
# 2

thankx for ur reply.But my String var contains the fallowing data.

[

URL = "http://www.apple.com/"

Title = "Apple"

Snippet = "Official site of Apple Computer, Inc."

Directory Category = {SE="", FVN=""}

Directory Title = ""

Summary = ""

Cached Size = "33k"

Related information present = true

Host Name = "www.apple.com"

],

how can i append '\' bfr "quote and end of " quote.does it possible without regular expressions?According to ur previous answer i got separation of URL,snippet and etc fields.How can i retrieve only URL,title,snippet info enclosed in quotation marks.

thanking you inadvance.

anchipkaa at 2007-7-10 14:20:36 > top of Java-index,Java Essentials,New To Java...
# 3

One simple solution may be as follows:

1. Tokenize the string using StringTokenizer with \n as the delimeter. In that case you will obtain each line in a new token.

2. Then again Tokenize the line which contains the URL with " (quote) as delimeter

3. In that case you will find the string http://www.apple.com/ in the 2nd token.

Hope it helps

diptaPBa at 2007-7-10 14:20:36 > top of Java-index,Java Essentials,New To Java...
# 4

...

According to ur previous answer i got

separation of URL,snippet and etc fields.How can i

retrieve only URL,title,snippet info enclosed in

quotation marks.

thanking you inadvance.

You should've continued in your original thread instead of cross posting it mutliple times.

Good luck with it.

prometheuzza at 2007-7-10 14:20:36 > top of Java-index,Java Essentials,New To Java...