begin
Screen.Cursor := crHourGlass;
startZeit := now;
x:=tstringlist.Create;
x.LoadFromFile('
C:\DB\DatenTest.tmp');
x.Text:= StringReplace(x.Text,'
ß','
SSSSSSS', [rfReplaceAll]);
x.Sort;
x.Text:= StringReplace(x.Text,'
SSSSSSS','
ß',[rfReplaceAll]);
x.SaveToFile('
sortiert.txt');
// ab hier wird es extrem langsam
a:=0;
stringgrid1.RowCount:=1;
//löscht überflüssige Leerzeilen
for b:=0
to x.count-1
do
begin
progressbar6.Max:= x.Count-1 ;
progressbar6.position:=b ;
progressbar6.Update;
if b>0
then begin
if x.strings[b]=x.Strings[b-1]
then begin
StringGrid1.cells[1,a]:= inttostr(strtoint (StringGrid1.cells[1,a])+1)
end else begin
inc(a);
StringGrid1.cells[1,a] := '
1';
StringGrid1.cells[0,a] := x.strings[b];
StringGrid1.RowCount := StringGrid1.RowCount+1;
end;
end else begin
StringGrid1.cells[0,a]:=x.Strings[b];
StringGrid1.cells[1,a]:='
1';
end;
end;
x.Destroy;
StopZeit := Now;
StatusBar6.Panels[1].Text :='
SuchZeit : '+ FormatDateTime('
nn:ss:zzz', StopZeit - StartZeit) ;
Screen.Cursor := crDefault;
end;