Click here to Skip to main content
15,919,358 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 9:44
Dhyanga21-Jul-10 9:44 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 9:51
mveOriginalGriff21-Jul-10 9:51 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 10:10
Dhyanga21-Jul-10 10:10 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 21:55
mveOriginalGriff21-Jul-10 21:55 
GeneralRe: problem writing in doc file Pin
Dhyanga22-Jul-10 3:00
Dhyanga22-Jul-10 3:00 
GeneralRe: problem writing in doc file Pin
OriginalGriff22-Jul-10 3:49
mveOriginalGriff22-Jul-10 3:49 
GeneralRe: problem writing in doc file Pin
Dhyanga22-Jul-10 4:14
Dhyanga22-Jul-10 4:14 
GeneralRe: problem writing in doc file [modified] Pin
Dhyanga22-Jul-10 4:17
Dhyanga22-Jul-10 4:17 
QuestionLine on open/close brackets Pin
Blubbo21-Jul-10 4:26
Blubbo21-Jul-10 4:26 
AnswerRe: Line on open/close brackets Pin
Ennis Ray Lynch, Jr.21-Jul-10 4:36
Ennis Ray Lynch, Jr.21-Jul-10 4:36 
AnswerRe: Line on open/close brackets Pin
OriginalGriff21-Jul-10 4:56
mveOriginalGriff21-Jul-10 4:56 
AnswerRe: Line on open/close brackets Pin
PIEBALDconsult21-Jul-10 18:22
mvePIEBALDconsult21-Jul-10 18:22 
Questionconvert date question Pin
Jassim Rahma21-Jul-10 3:36
Jassim Rahma21-Jul-10 3:36 
AnswerRe: convert date question Pin
OriginalGriff21-Jul-10 3:46
mveOriginalGriff21-Jul-10 3:46 
AnswerRe: convert date question Pin
Luc Pattyn21-Jul-10 3:47
sitebuilderLuc Pattyn21-Jul-10 3:47 
Questionhow to open www.google.com and insert any text to the textbox search (only for show) Pin
Gali197821-Jul-10 3:32
Gali197821-Jul-10 3:32 
AnswerRe: how to open www.google.com and insert any text to the textbox search (only for show) Pin
Luc Pattyn21-Jul-10 3:46
sitebuilderLuc Pattyn21-Jul-10 3:46 
GeneralRe: how to open www.google.com and insert any text to the textbox search (only for show) Pin
Jason Vetter21-Jul-10 4:31
Jason Vetter21-Jul-10 4:31 
QuestionRegex Problem,Extracting text from Table Pin
NaveenHS21-Jul-10 2:03
NaveenHS21-Jul-10 2:03 
Hello Everyone,

I am trying to extract the contents of the table from a static HTML file.
Program is almost giving the expected output.

Program :-
class Program
	{
		static void Main()
		{
			StreamReader str = new StreamReader("C:\\AllRoles.html");
			string SFile = str.ReadToEnd();
						
		    Regex regex = new Regex(
				@"<tr>(\s* <td[^>]*>  \s* (?<value>[^<]*?) \s* </td> )+ \s*</tr>",
		 		RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);


			 foreach( Match m in regex.Matches( SFile ) )
			 {
				foreach( Capture item in m.Groups["value"].Captures ) {

				Console.WriteLine( item.Value );
			}
			
				Console.WriteLine( );
			}
				Console.ReadLine();
		}
	}



I am facing one problem there is a comment in between the table content


HTML File :-


<table border="0" cellpadding="5" cellspacing="0" width="100%">
            <tbody><tr>
            <td class="columnheading" nowrap="nowrap">Last Name</td>
            <td class="columnheading" nowrap="nowrap">First Name</td>
           <td class="columnheading" nowrap="nowrap">Role</td>
           <td class="columnheading">Term</td>
           <td class="columnheading">Company</td>
           </tr>
           <tr>
           <td valign="top">

           <!-- Logic Here-->


           Gottlieb

           </td>
           <td valign="top">Pradep</td>
           <td valign="top">President

           </td>
           <td valign="top">8/15/2009 - 9/1/2010</td>
           <td valign="top">DSCMIT</td>

           </tr>
           <tr>
           <td valign="top">
           <!-- Logic Here-->


           Rajesh

           </td>
           <td valign="top">H</td>
           <td valign="top"> President

           </td>
           <td valign="top">8/15/2009 - 8/14/2010</td>
           <td valign="top">BHSIT</td>
           </tr>



I am getting the Output as

Last Name
First Name
Role
Term
Company

and it stops at this line <!-- Logic Here-->

Can anyone please help me to solve this problem.

Thanking you,
Naveen HS
AnswerRe: Regex Problem,Extracting text from Table Pin
Luc Pattyn21-Jul-10 2:13
sitebuilderLuc Pattyn21-Jul-10 2:13 
QuestionFunction Call Mechanism Pin
califax2k20-Jul-10 23:15
califax2k20-Jul-10 23:15 
AnswerRe: Function Call Mechanism Pin
PIEBALDconsult21-Jul-10 2:37
mvePIEBALDconsult21-Jul-10 2:37 
QuestionHow to call C# function from unmanaged C++ code.? Pin
deadlyabbas20-Jul-10 19:58
deadlyabbas20-Jul-10 19:58 
AnswerRe: How to call C# function from unmanaged C++ code.? Pin
Luc Pattyn20-Jul-10 23:14
sitebuilderLuc Pattyn20-Jul-10 23:14 
AnswerRe: How to call C# function from unmanaged C++ code.? Pin
Pete O'Hanlon21-Jul-10 2:34
mvePete O'Hanlon21-Jul-10 2:34 

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.