473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

string operation

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
2 1143
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Neil Schemenauer | last post by:
The title is perhaps a little too grandiose but it's the best I could think of. The change is really not large. Personally, I would be happy enough if only %s was changed and the built-in was...
11
by: ALI-R | last post by:
why c# function for string manupolation is not as strong as other languages ,for extracting a substring from a middle of another string ,I have a lot of problems. Any suggestion or I am in the...
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
1
by: varunhome | last post by:
Hi, I want to check for the absence of a string in regular expression. For example, if the string is "Error opening file: Permission denied. Aborting.", I want to check for absence of the string...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
13
by: Freaker85 | last post by:
Hello, I am new at programming in C and I am searching a manner to parse a string into an integer. I know how to do it in Java, but that doesn't work in C ;o) I searched the internet but I...
6
by: DaTurk | last post by:
Hi, I have several interfaces in CLI that I access via c#. My problem is, is that down in the unmanaged c++, which the CLI lies on top of, I have a lot of c_str() happening. But all of my...
0
by: Bart Kastermans | last post by:
|    def __str__ (self): I did some timing of operations involved. Doing this I found that the operation below to get a string representation for trees was in fact not quadratic. The final...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.