Folgende Version ist wesentlich schneller als die Stringlisten-Version:
Delphi-Quellcode:
IF FileExists(inFile) THEN
BEGIN
AssignFile(mfile, inFile);
Reset(mfile);
while not Eof(mfile) do
begin
Readln(mfile, mstr);
tmpstring := tmpstring+mstr;
end;
CloseFile(mfile);
OutStream := TMemoryStream.Create;
intstr := '';
TRY
FOR scount := 1 to Length(tmpstring) do
BEGIN
if tmpstring[scount] = delimiter THEN
BEGIN
intbyte := StrToInt(intstr);
OutStream.Write(intbyte,1);
intstr := '';
END
ELSE
BEGIN
intstr := intstr+tmpstring[scount];
END;
END;
intbyte := StrToInt(intstr);
OutStream.Write(intbyte,1);
OutStream.SaveToFile(outFile);
FINALLY
OutStream.Free;
END;
Result := TRUE;
END;