By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,021 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,021 IT Pros & Developers. It's quick & easy.

string operation

P: n/a
Hi,
I've got a table that contains a field of type nText.

Eeach records contains in this field the source code of a html page,
something like that...:
' <html>
<head>
<\head>
<body onload="bodyLoad()" >
<div>
<table>
<tr>
<td>
some stuff goes here
</td>
</tr>
</table>
</div>
</body>
<\html>'

I need to update the table and for each record, replace the content by
what is between the <body></body> markup (so basically, get rid off
what's not between the markup <body>)

How can I do that?

May 26 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
here we go, I've written the dataset to a xml file. I need to parse
this and get the content :

<FormattedText>
<FormattedTextID>230</FormattedTextID>
<Text><html> <head> <meta http-equiv=Content-Type content="text/html;
charset=windows-1252"> <meta name=Generator content="Microsoft Word 10
(filtered)"> <title>KEVIN ALLISON</title> <style> <!-- /* Font
Definitions */ @font-face {font-family:Times; panose-1:2 2 6 3 6 4 5 2
3 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm; margin-bottom:.0001pt; font-size:12.0pt;
font-family:Times;} p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm; margin-bottom:.0001pt; font-size:10.0pt;
font-family:"Times New Roman";} p.MsoFooter, li.MsoFooter,
div.MsoFooter {margin:0cm; margin-bottom:.0001pt; font-size:10.0pt;
font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} -->
</style> </head> <body lang=EN-GB> <div class=Section1> <p
class=MsoHeader><a name="OLE_LINK1"></a><a name="OLE_LINK5"></a><a
name="OLE_LINK15"></a><a name="OLE_LINK4"></a><a
name="OLE_LINK3"><b><span lang=EN-US>KEVIN </span></b><span
lang=EN-US>(M.) <b>ALLISON</b></span></a></p> <p class=MsoHeader><span
lang=EN-US>Financial Times</span></p> <p class=MsoHeader><span
lang=EN-US>Technology Correspondent</span></p> <p class=MsoHeader><span
lang=EN-US>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Beat (5/06):
</span></b><span lang=EN-US style='font-size: 10.0pt;font-family:"Times
New Roman"'>Computer companies and digital media</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Current
(5/06)</span></b><span lang=EN-US style='font-size:
10.0pt;font-family:"Times New Roman"'>: After covering the airline
industry and also writing about economic development for the Financial
Times, Mr. Allison began turning his attention to technology in October
of last year, and presumably relocated from </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New Roman"'>New
York</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times
New Roman"'> to the FT's </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>San
Francisco</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> bureau about
that time.</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Much of his
focus is on computer makers such as Dell, Hewlett Packard and Apple,
but he also writes about other aspects of technology.</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Since the
beginning of the year, he has written just two stories that were
lengthier than 1,000 words. Most of his work is short, 400-or -so- word
articles.</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>His two
lengthier pieces were:</span></b></p> <p class=MsoNormal><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New Roman"'>
The new internet independents - Entrepreneurship: Cheap
computing tools and hardware are giving start-ups the freedom to turn
down ... -- 4/13/06 (1,195 words)</span></p> <p class=MsoNormal><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New Roman"'>
A model defender for Dell. The Monday Interview with
Kevin Rollins: The head of the world's biggest PC maker has no doubts
about its flagship direct-selling strategy ... -- </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>3/13/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (1,257
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Examples of Mr.
Allison's most recent work includes:</span></b></p> <p
class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>
</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Dell drops
exclusive chip deal with Intel - </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New
Roman"'>5/19/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (306
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>
HP aims to reduce its costs by $1 billion - </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>5/18/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (287
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>
Solid HP extends winning streak - </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>5/17/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (332
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>
Yahoo picks users' brains in attempt to challenge Google -
</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>5/17/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (452
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>
Infor to acquire SSA in $1.4 billion deal - </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>5/16/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (370
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>
Investors expect to see HP advance - </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>5/15/06</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> (420
words)</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Mr. Allison has
made a few appearances on radio and TV including BBC-TV, CBS News Radio
and WABC.</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New
Roman"'>Address:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Times New Roman"'> </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New Roman"'>251 Post
St.</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times
New Roman"'> </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>San
Francisco</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>, </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>CA</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>94108</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Chain of
Command (5/06):</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> Reports to
Richard Waters, West Coast Editor</span></p> <p class=MsoNormal><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New
Roman"'>DOB</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Times New Roman"'>: </span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>June 21,
1978</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times
New Roman"'> <b>Joined</b>: 2003 <b>Ph</b>: 415.445.5603
<b>Fax</b>: 415.445.5615</span></p> <p class=MsoNormal><b><span
lang=EN-US style='font-size:10.0pt;font-family: "Times New
Roman"'>Email</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Times New Roman"'>: Ke***********@ft.com</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New
Roman"'>Education</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Times New Roman"'>: </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New
Roman"'>University</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> of </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>Missouri</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>, B.S. - 2000;
</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>Harvard</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>University</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>, M.P.P., public
policy</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Employment
History (5/06)</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>: Prior to
joining the Financial Times in its </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New Roman"'>New
York</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times
New Roman"'> bureau in 2003, Mr. Allison was a research associate at
</span><span lang=EN-US style='font-size: 10.0pt;font-family:"Times New
Roman"'>Harvard</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>Business</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>School</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> where he wrote
case studies on agribusiness.</span></p> <p class=MsoNormal><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Mr. Allison also
graduated from the FT's trainee journalist program and covered
breaking news on ft.com from </span><span lang=EN-US
style='font-size:10.0pt; font-family:"Times New
Roman"'>London</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>.</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Awards:
</span></b><span lang=EN-US style='font-size:10.0pt; font-family:"Times
New Roman"'>Mr. Allison was granted a Fulbright Scholarship in 2000 to
study biology in </span><span lang=EN-US style='font-size:10.0pt;
font-family:"Times New Roman"'>Austria</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> where he
specifically looked at biotechnology in Austrian society.</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>PERSONAL
(5/06): </span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>Mr. Allison
appears to have spent some of his formative years in </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman"'>Illinois</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'>. He speaks
French and German. He enjoys reading The Economist.</span></p> <p
class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>ADDITIONAL
INFORMATION:</span></b></p> <p class=MsoHeader><span
lang=EN-US>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New
Roman";color:black'>(John Batchelor Show - April 14, 2006):
</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Times
New Roman";color:black'>Mr. Allison was a guest on the radio program to
talk about The YouTube Revolution.</span></p> <p class=MsoNormal><span
lang=EN-US style='font-size:10.0pt;font-family:"Times New Roman";
color:black'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New
Roman";color:black'>(The Economist - </span></b><b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman";color:black'>May
1, 2004</span></b><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman";color:black'>):
</span></b><span lang=EN-US style='font-size: 10.0pt;font-family:"Times
New Roman";color:black'>In a letter to The Economist "a" Kevin
Allison writes that he is an American who has taken a job in
</span><span lang=EN-US style='font-size:10.0pt;font-family:"Times New
Roman";color:black'>London</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman";color:black'> and
would like to know more about British "football" clubs. NewsBios
assumes that this is the same Kevin Allison of the Financial
Times.</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman";
color:black'>&nbsp;</span></p> <p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family: "Times New Roman"'>Research
Conclusions (5/06):</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New Roman"'> Our research
found no evidence of any of the following: That Mr. Allison has written
a published book; is an officer of any journalism professional groups;
won any significant journalism awards; is a regular guest on broadcast
news or public affairs programs; has been involved in any journalism
controversy of substance or has been the subject of a libel or
defamation lawsuit.</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> <p class=MsoNormal><span lang=EN-US
style='font-size:10.0pt;font-family:"Times New
Roman"'>&nbsp;</span></p> </div> </body> </html></Text>
<CreatedBy>1</CreatedBy>
<DateCreated>1900-01-02T00:00:00+00:00</DateCreated>
<LastModifiedBy>1</LastModifiedBy>
<DateLastModified>1900-01-02T00:00:00+00:00</DateLastModified>

May 26 '06 #2

P: n/a
On 26 May 2006 07:16:00 -0700, sa*************@googlemail.com wrote:
Hi,
I've got a table that contains a field of type nText.

Eeach records contains in this field the source code of a html page,
something like that...:
' <html>
<head>
<\head>
<body onload="bodyLoad()" >
<div>
<table>
<tr>
<td>
some stuff goes here
</td>
</tr>
</table>
</div>
</body>
<\html>'

I need to update the table and for each record, replace the content by
what is between the <body></body> markup (so basically, get rid off
what's not between the markup <body>)

How can I do that?


string html = "<html><body>between</body></html>";
string pattern = "(<body>).*(</body>)";
Match match = Regex.Match(html, pattern);
if (match.Success)
{
string result = match.Value;
}

--
Ludwig Stuyck
http://www.coders-lab.be
May 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.