Thema: Delphi mapped file

Einzelnen Beitrag anzeigen

mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

mapped file

  Alt 7. Apr 2008, 22:56
Hello every one :

I have a Text File its size is about : 15 MB and i want to compare its lines with other text File . for the first time i used the TStringList to open the First File ( when its size was about 10 KB ) so i hade no problem and i used the TStringList like this :
Delphi-Quellcode:
--
Var
SL:TStringList;
S:String;
begin
//Load the text file (test.txt ) into the TStringList then use
For i:=0 to SL -1 do
if S=SL.Strings[i] then
Showmessage('yes :'+S+' is found in the file' );
...
...
end;
but when the File becoms more and more huge the TStringList takes forever to load the File's Lines and do the comparasion.
so what i think is to map the First File then do the comparasion and here is my question :
is there any function or procedure that loads the mapped file into the stringlist and do the comparasion very fast .


many thanks
  Mit Zitat antworten Zitat