Load the file into a memo control. If it recognizes the lines, your problem is 
solved. If not, you can always write a function to seek out the #10 chars. and 
add a #13 next to them. Then it will for sure.

Dave

--- On Thu, 10/30/08, darckness000 <[EMAIL PROTECTED]> wrote:
From: darckness000 <[EMAIL PROTECTED]>
Subject: [delphi-en] Line feed (#10) terminated lines in files
To: [email protected]
Date: Thursday, October 30, 2008, 6:59 PM










    
            Hi Everybody,



I'm trying to read line-feed (ASCII #10) terminated lines from a file 

(think UNIX file), not the usual CRLF (ASCII #13 #10) terminated 

lines.



What I'm doing at the moment is to `Read' 1 char at a time into a var 

until I hit an LF + then display the string to the user. While this 

works, it is sloooowwwwwwwwww when seeking to the last line in a 

large file.



I've tried using `Read' with zero based character arrays - + while 

this is much faster, read fills the array completely (ie: if the 

array is [0..999], Read will read 1000 chars from the file) instead 

of stopping at the LF in the file. As each line in the file is 

variable in length, I am unable to allocate a static array. Dynamic 

arrays don't work with `Read', but as I don't the length of each 

string in the file this doesn't really matter.



When comparing speed against what I'm currently doing + using ReadLn 

(ReadLn doesn't read the LF, I was just testing speed), ReadLn is so 

much quicker it's unbelievable.



My question is, does anyone know of a way to read LF terminated lines 

from a file with speed comparable to ReadLn?



Thanks :-)




      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to