Click here to Skip to main content
15,889,266 members
Home / Discussions / C#
   

C#

 
AnswerRe: RtlSetProcessIsCritical, Marshall and pointers. Pin
Luc Pattyn19-Jul-10 5:33
sitebuilderLuc Pattyn19-Jul-10 5:33 
GeneralRe: RtlSetProcessIsCritical, Marshall and pointers. Pin
Night Lol19-Jul-10 5:52
Night Lol19-Jul-10 5:52 
QuestionUnable to reference shared assembly in GAC [modified] Solved Pin
Jonathan Davies19-Jul-10 2:30
Jonathan Davies19-Jul-10 2:30 
AnswerRe: Unable to reference shared assembly in GAC Pin
PIEBALDconsult19-Jul-10 3:13
mvePIEBALDconsult19-Jul-10 3:13 
GeneralRe: Unable to reference shared assembly in GAC Pin
Jonathan Davies19-Jul-10 4:02
Jonathan Davies19-Jul-10 4:02 
QuestionHTML Table tag text Scraping Pin
NaveenHS19-Jul-10 0:48
NaveenHS19-Jul-10 0:48 
AnswerRe: HTML Table tag text Scraping Pin
Luc Pattyn19-Jul-10 0:57
sitebuilderLuc Pattyn19-Jul-10 0:57 
GeneralRe: HTML Table tag text Scraping Pin
NaveenHS19-Jul-10 1:45
NaveenHS19-Jul-10 1:45 
Thanks Luc Pattyn for the response.

I corrected the mistakes as follows


HTML File :-

<html>
<body>

<table>
<tr>
<th>Team Name</th>
<th>Place</th>
</tr>
<tr>
<td>Kings XI Punjab</td>
<td>Punjab</td>
</tr>
<tr>

<td>Chennai Super Kings</td>
<td>Chennai</td>
</tr>

<tr>
<td>Deccan Chargers</td>
<td>Hydrabad</td>
</tr>



</table>


</body>

</html>


Program :-

<br />
static void Main()<br />
	{<br />
		StreamReader str = new StreamReader("C:\\Test.html");<br />
		string strLings = str.ReadToEnd();<br />
		int startIndex = strLings.IndexOf("<table>");<br />
		int endInedx = strLings.IndexOf("</table>") + "</table>".Length - startIndex;<br />
		string strTab = strLings.Substring(1, endInedx);<br />
		str.Close();<br />
		StreamWriter strWr = new StreamWriter("C:\\test2.txt", true);<br />
		strWr.Write(strTab);<br />
		strWr.Close();<br />
<br />
		Console.ReadLine();<br />
	}<br />




Getting the output as below written to the file ..
Not getting the required out put .. Frown | :( I will try with Regular Expression now.

html>
<body>

<table>
<tr>
<th>Team Name</th>
<th>Place</th>
</tr>
<tr>
<td>Kings XI Punjab</td>
<td>Punjab</td>
</tr>
<tr>

<td>Chennai Super Kings</td>
<td>Chennai</td>
</tr>

<tr>
<td>Deccan Chargers</td>
<td>Hydrabad</td>
</tr
GeneralRe: HTML Table tag text Scraping Pin
Not Active19-Jul-10 5:41
mentorNot Active19-Jul-10 5:41 
AnswerRe: HTML Table tag text Scraping Pin
ragnaroknrol19-Jul-10 4:04
ragnaroknrol19-Jul-10 4:04 
GeneralRe: HTML Table tag text Scraping Pin
Luc Pattyn19-Jul-10 4:29
sitebuilderLuc Pattyn19-Jul-10 4:29 
AnswerRe: HTML Table tag text Scraping Pin
PIEBALDconsult19-Jul-10 4:21
mvePIEBALDconsult19-Jul-10 4:21 
QuestionReading user/group of your local machine Pin
dabuskol19-Jul-10 0:39
dabuskol19-Jul-10 0:39 
QuestionHi Pin
KORCARI18-Jul-10 23:27
KORCARI18-Jul-10 23:27 
AnswerRe: Hi Pin
Mycroft Holmes19-Jul-10 2:57
professionalMycroft Holmes19-Jul-10 2:57 
GeneralRe: Hi Pin
KORCARI19-Jul-10 3:19
KORCARI19-Jul-10 3:19 
QuestionSending XML over a Socket connection Pin
Priya Prk18-Jul-10 22:53
Priya Prk18-Jul-10 22:53 
AnswerRe: Sending XML over a Socket connection Pin
Peace ON18-Jul-10 23:08
Peace ON18-Jul-10 23:08 
QuestionRead both attributes and subtree of an XML element using XmlTextReader Pin
PPKeno18-Jul-10 22:05
PPKeno18-Jul-10 22:05 
AnswerRe: Read both attributes and subtree of an XML element using XmlTextReader Pin
Peace ON18-Jul-10 22:34
Peace ON18-Jul-10 22:34 
QuestionReading .dbc file in C# Pin
Niungareamit18-Jul-10 20:14
Niungareamit18-Jul-10 20:14 
AnswerRe: Reading .dbc file in C# Pin
V.18-Jul-10 20:32
professionalV.18-Jul-10 20:32 
AnswerRe: Reading .dbc file in C# Pin
Richard MacCutchan18-Jul-10 22:33
mveRichard MacCutchan18-Jul-10 22:33 
QuestionReading Microsoft Project file problem Pin
DJ24518-Jul-10 17:42
DJ24518-Jul-10 17:42 
AnswerRe: Reading Microsoft Project file problem Pin
Peace ON18-Jul-10 22:49
Peace ON18-Jul-10 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.