Pattern matching Question

R

Raju Alluri

Hi ,
I have a below log text
ADS=<GSP><ADS><AD n="1" slot="s" visible_url="www.w9.com"
url="http://xyz.com:80/srv/redirect/?key=vvMN3-AAA&amp;s="
catid="all_tv" view_id="vPuC" provider="AdagioFeed"><LINE1>gt sv
ca</LINE1><LINE2>line 1 line 2</LINE2><LINE3 /></AD><AD n="2" slot="s"
visible_url="www.rice.edu"
url="http://xyz:80/srv/redirect/?key=kN3-AAB&amp;s="
catid="cat_homeservices_install_tv" view_id="kR-AAB"
provider="AdagioFeed"><LINE1>c2 tv installation</LINE1><LINE2>line
1</LINE2><LINE3 /></AD><AD n="1" slot="a" visible_url="samsung.com/us"
url="http://xyz.com:80/srv/redirect/?info=ACoJO&amp;awt=1&amp;s="
provider="GoogleFeed"><LINE1>&lt;b&gt;Samsung&lt;/b&gt; New
&lt;b&gt;SAMSUNG&lt;/b&gt; TV</LINE1><LINE2>Stylish
&lt;b&gt;LCD&lt;/b&gt; Full &lt;b&gt;HDTV&lt;/b&gt; with Quality. Find
Karim&amp;#39;s Design with &lt;b&gt;Samsung&lt;/b&gt; TV</LINE2><LINE3
/></AD><AD n="2" slot="a" visible_url="www.AbesOfMaine.com"
url="www.xyz.com:80/srv/redirect/?info=AGqQ__&amp;awt=1&amp;s="
provider="GoogleFeed"><LINE1>&lt;b&gt;LN32A450 HDTV&lt;/b&gt; on
Sale</LINE1><LINE2>Great Deals on &lt;b&gt;Samsung
Ln32a450&lt;/b&gt;</LINE2><LINE3>In Stock, Free Shipping, Order
Now</LINE3></AD><AD n="3" slot="a" visible_url="www.smart-review.com"
url="http://xyz.com:80/srv/redirect/?info=ANmELI_&amp;awt=1&amp;s="
provider="GoogleFeed"><LINE1>Top Rated HDTVs for
2008</LINE1><LINE2>1080p High DefinitionTelevisions
-</LINE2><LINE3>Owner Reviews. 2008 Buying
Guide.</LINE3></AD></ADS><VIEW_BASE_URL>a9adam-staging-adserver.amazon.com:80/srv/view</VIEW_BASE_URL><CATEGORIES>

I want to extract data in the below format. Could someone give me the
pattern for this ? Thanks a lot in Advance.

n="1" slot="s" visible_url="www.w9.com" provider="AdagioFeed" <LINE1>gt
sv ca</LINE1>
n="2" slot="s" visible_url="www.rice.edu" provider="AdagioFeed"
<LINE1>c2 tv installation</LINE1>
n="1" slot="a" visible_url="samsung.com/us" provider="GoogleFeed"
<LINE1>&lt;b&gt;Samsung&lt;/b&gt; New &lt;b&gt;SAMSUNG&lt;/b&gt;
TV</LINE1>
n="2" slot="a" visible_url="www.AbesOfMaine.com" provider="GoogleFeed">
<LINE1>&lt;b&gt;LN32A450 HDTV&lt;/b&gt; on Sale</LINE1>
n="3" slot="a" visible_url="www.smart-review.com" provider="GoogleFeed">
<LINE1>Top Rated HDTVs for 2008</LINE1>

One more thing is some lines are like &lt;b&gt;Samsung&lt;/b&gt; New
&lt;b&gt;SAMSUNG&lt;/b&gt; Will there be a way to eextract only "Samsung
New SAMSUNG" out of this ?
 
R

Rüdiger Brahns

Hi Raju

If you don't have a solution yet, please post the original log text to
pastebin.com or something like that, so that I can see where line breaks
are.

R.
 
R

Raju Alluri

Rüdiger Brahns said:
Hi Raju

If you don't have a solution yet, please post the original log text to
pastebin.com or something like that, so that I can see where line breaks
are.

R.

Hi Rüdiger
I got a solution for this. Thank you.

-Raju
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top