35 milyon satırlık text satırı olan bir metin dosyası var elimde ve ben elimde 55 bin satırlık farklı bitextteki satırları büyük olanın içinde aramak istiyorum
bütün satırlar 15 karakterden ve hexadeciamal içerikten oluşuyo en hızlı ve kesin çözüm ne olabilir
35 milyon satırlık text dosyada yineleme
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
Şöyle bir procedure işinizi görecektir:
İyi çalışmalar.
Kod: Tümünü seç
procedure MetniDuzenle(const aSourceTextFileName, aFindTextFileName, aTargetTextFileName: string);
var
aSourceTextFile: TextFile;
aTargetTextFile: TextFile;
aList: TStringList;
aSortedList: TStringList;
St: string;
I, F, aSayac: Integer;
begin
aList := TStringList.Create;
aSortedList := TStringList.Create;
try
aSortedList.Sorted := TRUE;
aList.LoadFromFile(aFindTextFileName);
for I := 0 to aList.Count - 1 do
if not aSortedList.Find(aList[I], F) then aSortedList.Add(aList[I]);
aList.Clear;
AssignFile(aSourceTextFile, aSourceTextFileName);
Reset(aSourceTextFile);
AssignFile(aTargetTextFile, aTargetTextFileName);
Rewrite(aTargetTextFile);
aSayac := 0;
while not Eof(aSourceTextFile) do
begin
Inc(aSayac);
if aSayac mod 10000 = 0 then Sleep(1);
Readln(aSourceTextFile, St);
if not aSortedList.Find(St, F) then Writeln(aTargetTextFile, St);
end;
CloseFile(aSourceTextFile);
CloseFile(aTargetTextFile);
finally
aList.Free;
aSortedList.Free;
end;
end;
MetniDuzenle('C:\Test1.TXT', 'C:\Test2.TXT', 'C:\Test3.TXT');
FastStrings string işleme fonksiyonu
fastStrings
FREE: A useful set of assembly optimised string manipulation routines. The most remarkable of these is without a doubt the FastReplace function. StringReplace took over 8 hours to complete multiple replacements on a 10mb string, whereas FastReplace took 0.5 seconds (yes, half of a second).
.-.-.-.-.-.-.-. ^_^