Re: IO function in Vb.Net slower than in Vb6.0

Tech-Archive recommends: Speed Up your PC by fixing your registry



"hillcountry74" <shruthibg@xxxxxxxxx> wrote in
news:1112223769.480509.272010@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

> Thanks a lot MP. Really appreciate your help.
>
> Can you please paste the regular expression for this? Can't find it in
> the code.
>
> Also, on the headofhouse, it could be alphanumeric. And yes, some
> fields would be blank.
>
> There could be files of size 400MB. In such a case, reading till
> endoffile might not work. Instead, if it is changed to reading one
line
> at a time, do you think the speed will reduce?
>
> Thanks again.
>

This is the Regular Expression:
Dim _exp As String = "((?<ActionCode>.{1})" & _
"(?<CarrierID>.{25})" & _
"(?<LastName>.{60})" & _
"(?<FirstName>.{30})" & _
"(?<MiddleName>.{15})" & _
"(?<Addr1>.{60})" & _
"(?<Addr2>.{60})" & _
"(?<City>.{30})" & _
"(?<State>.{2})" & _
"(?<Zip>.{10})" & _
"(?<BenefitOption>.{60})" & _
"(?<EmployerGroup>.{15})" & _
"(?<OptionEffDate>.{8})" & _
"(?<HPEffDate>.{8})" & _
"(?<TermDate>.{8})" & _
"(?<Sex>.{1})" & _
"(?<DOB>.{8})" & _
"(?<SSN>.{9})" & _
"(?<Phone>.{12})" & _
"(?<EmployerGroupAnivDate>.{8})" & _
"(?<HeadOfHouse>.{9})" & _
"(?<PrimaryStatus>.{1})" & _
"(?<MaritalStatus>.{1}))"

A pretty good definition can be found on MSDN. Search For RegEx or
Regular Expressions. :)

I'll try to "simulate"(wink wink:) a 400mb file and check performance.
Reading one line at a time is out of the question for this experiment,
as it would require a couple of million reads(guessing), reading in
442bytes * nRecords would be better if not the best way to do it. BUT
this and ReadToEnd both REQUIRE every record to be 442 bytes (or
whatever it is) Off by one byte, and kiss you're records goodbye.

MP
.



Relevant Pages

  • Re: IO function in Vb.Net slower than in Vb6.0
    ... returned does not contain the terminating carriage return or line feed. ... before you can apply the RegEx anyway. ... >> Can you please paste the regular expression for this? ... if it is changed to reading one ...
    (microsoft.public.dotnet.languages.vb)
  • Re: need help for regular expression
    ... If there's a chance that there will be nested parentheses, ... It seems like you're often asking regular expression questions. ... highly recommend picking up Mastering Regular Expressions by Jeffrey ... After reading just the first two chapters, ...
    (comp.lang.ruby)
  • Re: Find files matching multiple patterns.
    ... You'd do well to do some more reading of ‘grep’. ... A regular expression can have alternation in it: ... when GNU grep can do it for you: ...
    (comp.unix.shell)
  • Re: IO function in Vb.Net slower than in Vb6.0
    ... Can you please paste the regular expression for this? ... Also, on the headofhouse, it could be alphanumeric. ... if it is changed to reading one line ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: As I can determining if string can be turned to a numerico value?
    ... I tend to do most of my work in Perl, so regex and parsing is second nature, ... the scripts are small and the speed of execution is usually ... > Denis Dougall wrote: ... > check which is many times quicker than a regular expression. ...
    (microsoft.public.dotnet.languages.csharp)