Efectivamente egostar, parece que la instrucción FileSize no funciona muy bien con los archivos de texto. Pero todo tiene solución:
Código Delphi
[-]
var
Str: String;
Source, Dest: TextFile;
Size: Integer;
F: File;
begin
Size:= 0;
AssignFile(F,'C:\Origen.txt');
{$I-}
Reset(F,1);
{$I+}
if IOResult = 0 then
begin
Size:= FileSize(F) div 2;
CloseFile(F);
end;
AssignFile(Source,'C:\Origen.txt');
{$I-}
Reset(Source);
{$I+}
if IOResult = 0 then
begin
AssignFile(Dest,'C:\Trozo1.txt');
{$I-}
Rewrite(Dest);
{$I+}
if IOResult = 0 then
begin
while (not Eof(Source)) and (Size > 0) do
begin
Readln(Source,Str);
Writeln(Dest,Str);
dec(Size,Length(Str)+2);
end;
CloseFile(Dest);
end;
AssignFile(Dest,'C:\Trozo2.txt');
{$I-}
Rewrite(Dest);
{$I+}
if IOResult = 0 then
begin
while not Eof(Source) do
begin
Readln(Source,Str);
Writeln(Dest,Str);
end;
CloseFile(Dest);
end;
CloseFile(Source);
end
end;