Re: Lines in a text file

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Larry,

Ok Initially what I did was the following since I already knew that all
lines within the text file were of the same size.

Say for example I knew my lines of text within the file were all 410
characters in length.

I used the following:

numOf Lines = FILELEN("e:\chess\file") / 410

This was the code I had tried that didnt produce the exact number. Your
thought of taking into consideration the cr/lf could be the problem since I
did not take them into account. I will have to play with it a bit. I do
remeber a long time ago when I crossed this bridge isnt the filename itself
have something to do with the size??? Perhaps I could be mistaken but just
throwing it out.

Thanks Larry for your suggestions,

Les

"Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message
news:OAekcM5UFHA.2172@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Les" <vb4@xxxxxxxxxxx> wrote
> > Note that each
> > line in the text file will be of the same length which I forgot to
mention
> > to you initially, sorry for that. I was thinking if I knew the length
of
> > the first line and was able to get the total size in bytes of the file
that
> > a simple division would get the right answer but it appears that I am
always
> > slightly off.
>
> Post your exact code. Perhaps someone will see why you are slightly
off....
>
> How far are you off?
> (Did you account for the CrLf characters? Is there an extra line at the
end?)
>
>
> LFS
>
>


.



Relevant Pages

  • Re: Lines in a text file
    ... (Did you account for the CrLf characters? ... LFS ... Prev by Date: ...
    (microsoft.public.vb.general.discussion)
  • Re: Lines in a text file
    ... not account for the cr/lf and need to find out what is at the end of the ... Thanks Larry for your suggestions, ... >:> Post your exact code. ...
    (microsoft.public.vb.general.discussion)
  • Re: Lines in a text file
    ... Does the 410 account for 2 characters for each linefeed in the file? ... Thanks Larry for your suggestions, ... :> Post your exact code. ...
    (microsoft.public.vb.general.discussion)