Advertisement

04.17.2007 at 06:10AM PDT, ID: 22515907
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

StreamReader, Regular Expressions for better performance

Asked by navstar16 in Microsoft Visual Basic.Net

Tags:

hi Techie's,

1) Does StreamReader.ReadToEnd method loads the entire file line by line through a "while loop" internally

2) RegEx when searching the string, does it search/scan the file using the "while loop" internally


i have 2 codes doing the same thing, if i know the method which is faster when seraching the text in double quotes inside the file(s), i would be using the same for better performance.

the following code is actually scanning the files for the string in double quotes and would get me the list accordingly in a collection and then the collection is looped to insert the values into the database


                Dim regularExpression As Regex = New Regex(sVBPattern)
                Dim matchResult As MatchCollection
                Dim sPattern As String = sVBPattern
                Dim fs As New FileStream(sFilePath, FileMode.Open, FileAccess.Read)
                Dim objtxtrdr As TextReader
                objtxtrdr = File.OpenText(sFilePath)
                Dim text As String = objtxtrdr.ReadToEnd()

                matchResult = regularExpression.Matches(Text)
                Dim objMatch As Object
                For Each objMatch In matchResult
                  '  Console.WriteLine(objMatch) '************** insert query needs to be written***********
                    '*****************************************
                    InsertInDB(sFile.Substring(sFile.LastIndexOf("\") + 1), sFilePath, objMatch.tostring, sPattern)
                Next

'*****************************code 2***********************************
Do
   line = sr.ReadLine()

 'same code for regularExpression checking and matching and then inserting in to the database
'regular expression checking would be done with the help of IsMatch method and Match, NextMatch
   i += 1

Loop Until line Is Nothing


Thanks,

M.Naveen Swamy

Start Free Trial
[+][-]04.17.2007 at 07:39AM PDT, ID: 18924563

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: streamreader
Sign Up Now!
Solution Provided By: FernandoSoto
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.17.2007 at 11:44AM PDT, ID: 18926518

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2007 at 11:52AM PDT, ID: 18926579

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2007 at 12:39PM PDT, ID: 18926874

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.17.2007 at 10:25PM PDT, ID: 18929743

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.17.2007 at 10:46PM PDT, ID: 18929789

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 11:43AM PDT, ID: 18954816

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 11:58AM PDT, ID: 18954859

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 12:11PM PDT, ID: 18954891

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 12:21PM PDT, ID: 18954914

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 12:29PM PDT, ID: 18954935

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 12:37PM PDT, ID: 18954968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2007 at 04:50PM PDT, ID: 18962547

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.23.2007 at 10:55PM PDT, ID: 18963631

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2007 at 05:46AM PDT, ID: 18965194

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32