Sergei

You could prob speed it up by reading 'Blocks' into mem
and counting CR/LF pairs, only thing you'd have to check for
is CR/LF split on block Boundaries

HTH
Neven

----- Original Message -----
From: Sergei Stenkov <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Tuesday, 20 March 2001 15:47
Subject: [DUG]: Number of lines in text file


> I need to get the number of lines/records in a text file
> Using this:
>   while not Eof(F) do begin
>     ReadLn(F);
>     Inc(iRows);
>   end;
> gets me that number, but is rather slow if say I run it against a file
with
> a few hundreds of thousand lines.
>
> I wonder if there is a more efficient way of doing the same?
>
> Thank you,
> Sergei
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to